参考:https://www.learnopencv.com/install-dlib-on-ubuntu/
Step 1: Install OS libraries
sudo apt-get install build-essential cmake pkg-config
sudo apt-get install libx11-dev libatlas-base-dev
sudo apt-get install libgtk-3-dev libboost-python-dev
Step 2: Install Python libraries
已安装
Step 3: Compile DLib
Step 3.1: Compile C++ binary
下载 dlib
cd dlib-19.6/
mkdir build
cd build
cmake ..
cmake --build . --config Release
sudo make install
sudo ldconfig
cd ..
使用pkg-config设置Dlib的头文件和动态链接库文件的路径
pkg-config --libs --cflags dlib-1
Step 3.2: Compile Python module
首先进入python虚拟环境
cd dlib-19.6
python setup.py install
rm -rf dist
rm -rf tool/python/build
mv python_examples/dlib.so venv/27py/lib/python2.7/site-packages/
在别的虚拟环境中,重复上述过程
网友评论