face_recognition使用dlib库面部识别功能构建而成
安装dlib
git clone https://github.com/davisking/dlib.git
编译
cd dlib
mkdir build
cd build
cmake ..
cmake --build .
安装
cd ..
python3 setup.py install
在安装过程中可能报错
fatal error: Python.h: No such file or directory #include <Python.h>
解决方法:
如果python版本是python3.x,则输入命令
sudo apt-get install python3.x-dev
如果python版本是python2.7,则输入命令
sudo apt-get install python-dev
安装完之后运行python,然后 import dlib,如果没有报错则安装成功
下载face_recognition模块
pip3 install face_recognition
安装完之后,就可以导入该模块使用