Step #1: Install dlib prerequisites
The dlib library only has four primary prerequisites:html
- Boost: Boost is a collection of peer-reviewed (i.e., very high quality) C++ libraries that help programmers not get caught up in reinventing the wheel. Boost provides implementations for linear algebra, multithreading, basic image processing, and unit testing, just to name a few.
- Boost.Python: As the name of this library suggests, Boost.Python provides interoperability between the C++ and Python programming language.
- CMake: CMake is an open-source, cross-platform set of tools used to build, test, and package software. You might already be familiar with CMake if you have used it to compile OpenCV on your system.
- X11/XQuartx: Short for 「X Window System」, X11 provides a basic framework for GUI development, common on Unix-like operating systems. The macOS/OSX version of X11 is called XQuartz.
In order to install Boost, Boost.Python, and CMake on macOS, you’ll be using the Homebrew package manager.python
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew update
Install python2.7 & python3.6 git
$ brew install python
$ brew install python3
Install CMake, Boost & Boost-Python github
$ brew install cmake
$ brew install boost
$ brew install boost-python --with-python3
Check the Install Result ruby
$ brew list | grep 'boost'
boost
boost-python
Step #2: Install dlib with Python bindings
Numpy, Scipy & scikit-image for image processing or computer vision python2.7
$ pip install numpy
$ pip install scipy
$ pip install scikit-image
Use pip install dlib curl
$ pip install dlib
![](http://static.javashuo.com/static/loading.gif)
You should see that dlib has been successfully installed.ide