Pre-reqs:
- Have Python 3 installed. On macOS, this could be installed from homebrew or even via standard Python 3.6 downloaded installer from https://www.python.org/download. On Linux, just use your package manager.
- On macOS:
- Install XCode from the Mac App Store (or install the XCode command line utils).
- Have homebrew installed
- On Linux:
- For a full list of apt packages required, check out the example Dockerfile and copy what's installed there.
- These instructions assume you are using Ubuntu 16.04 or newer. If you are using 14.04, you can try these installation instructions instead to work around the old CMake version.
- These instructions assume you don't have an nVidia GPU and don't have Cuda and cuDNN installed and don't want GPU acceleration (since none of the current Mac models support this).
Clone the code from github:
git clone https://github.com/davisking/dlib.gitBuild the main dlib library (optional if you just want to use Python):
cd dlib
mkdir build; cd build; cmake ..; cmake --build .Build and install the Python extensions:
cd ..
python3 setup.py installAt this point, you should be able to run python3 and type import dlib successfully.
I have noticed there have some problem with dlib version 19.24.99, there is no 19.24.99 for dlib(only 19.24.0). Is there any comment of this issue?
`[100%] Built target _dlib_pybind11
creating build/bdist.macosx-10.9-universal2
creating build/bdist.macosx-10.9-universal2/egg
creating build/bdist.macosx-10.9-universal2/egg/dlib
copying build/lib.macosx-10.9-universal2-cpython-39/dlib/init.py -> build/bdist.macosx-10.9-universal2/egg/dlib
copying build/lib.macosx-10.9-universal2-cpython-39/_dlib_pybind11.cpython-39-darwin.so -> build/bdist.macosx-10.9-universal2/egg
byte-compiling build/bdist.macosx-10.9-universal2/egg/dlib/init.py to init.cpython-39.pyc
creating stub loader for _dlib_pybind11.cpython-39-darwin.so
byte-compiling build/bdist.macosx-10.9-universal2/egg/_dlib_pybind11.py to _dlib_pybind11.cpython-39.pyc
creating build/bdist.macosx-10.9-universal2/egg/EGG-INFO
copying tools/python/dlib.egg-info/PKG-INFO -> build/bdist.macosx-10.9-universal2/egg/EGG-INFO
copying tools/python/dlib.egg-info/SOURCES.txt -> build/bdist.macosx-10.9-universal2/egg/EGG-INFO
copying tools/python/dlib.egg-info/dependency_links.txt -> build/bdist.macosx-10.9-universal2/egg/EGG-INFO
copying tools/python/dlib.egg-info/not-zip-safe -> build/bdist.macosx-10.9-universal2/egg/EGG-INFO
copying tools/python/dlib.egg-info/top_level.txt -> build/bdist.macosx-10.9-universal2/egg/EGG-INFO
writing build/bdist.macosx-10.9-universal2/egg/EGG-INFO/native_libs.txt
creating dist
creating 'dist/dlib-19.24.99-py3.9-macosx-10.9-universal2.egg' and adding 'build/bdist.macosx-10.9-universal2/egg' to it
removing 'build/bdist.macosx-10.9-universal2/egg' (and everything under it)
Processing dlib-19.24.99-py3.9-macosx-10.9-universal2.egg
creating /Users/kingston/Doc/workplace/py_venv/lab_faceRec/lib/python3.9/site-packages/dlib-19.24.99-py3.9-macosx-10.9-universal2.egg
Extracting dlib-19.24.99-py3.9-macosx-10.9-universal2.egg to /Users/kingston/Doc/workplace/py_venv/lab_faceRec/lib/python3.9/site-packages
Adding dlib 19.24.99 to easy-install.pth file
Installed /Users/kingston/Doc/workplace/py_venv/lab_faceRec/lib/python3.9/site-packages/dlib-19.24.99-py3.9-macosx-10.9-universal2.egg
Processing dependencies for dlib==19.24.99
Searching for dlib==19.24.99
Reading https://pypi.org/simple/dlib/
/Users/kingston/Doc/workplace/py_venv/lab_faceRec/lib/python3.9/site-packages/pkg_resources/init.py:123: PkgResourcesDeprecationWarning: is an invalid version and will not be supported in a future release
warnings.warn(
No local packages or working download links found for dlib==19.24.99
error: Could not find suitable distribution for Requirement.parse('dlib==19.24.99')
`