世界上最简单的面部识别为Python和命令行api
2018-01-23 20:14
357 查看
世界上最简单的面部识别为Python和命令行api https://github.com/ageitgey/face_recognition
模型使用了C++工具箱dlib基于深度学习的最新人脸识别方法,基于户外脸部数据测试库Labeled Faces in the Wild 的基准水平来说,达到了99.38%的准确率。
dlib:http://dlib.net/
数据测试库Labeled Faces in the Wild:http://vis-www.cs.umass.edu/lfw/
模型提供了一个简单的 face_recognition 命令行工具让用户通过命令就能直接使用图片文件夹进行人脸识别操作。
安装
pip3 install face_recognition
如果报错:ubuntu下安装dlib,http://blog.csdn.net/funny75/article/details/51582056
dlib官网 http://dlib.net/compile.html 进入官网下载安装包,解压后放到 /usr/local/lib/python2.7/dist-packages 目录下(或者3.5,根据自己的python版本选择)
安装编译所需工具
sudo apt-get install cmake
(如果报错:软件包 cmake 没有可安装候选,先sudo apt-get update)
sudo apt-get install libboost-python-dev
进入dlib的目录
sudo python3 setup.py install
(如果发生错误:python-3-importerror-no-module-named-setuptools,先对于Python 3. x
sudo apt-get install python3-setuptools)
(如果发生错误:/usr/local/lib/python3.5/dist-packages/dlib-19.10/dlib/external/pybind11/include/pybind11/detail/common.h:111:20: fatal error: Python.h: 没有那个文件或目录:那么:sudo apt install python3.5-dev)
然后再 运行pip3 install face_recognition来完成安装。
测试:
接下来你只用运行face_recognition命令,程序能够通过已知人脸的文件夹识别出未知人脸照片中的人是谁;
针对每个人脸都要一行输出,数据是文件名加上识别到的人名,以逗号分隔。
如果你只是想要知道每个照片中的人名而不要文件名,可以进行如下操作:
Python模块,实现人脸识别
你可以通过引入face_recognition就能完成人脸识别操作:
API 文档: https://face-recognition.readthedocs.io.
在图片中自动识别所有人脸
请参照此案例: https://github.com/ageitgey/face_recognition/blob/master/examples/find_faces_in_picture.py
识别图片中的人脸并告知姓名
请参照此案例this example: https://github.com/ageitgey/face_recognition/blob/master/examples/recognize_faces_in_pictures.py
Python代码案例
所有例子在此 here. https://github.com/ageitgey/face_recognition/tree/master/examples
找到照片中的人脸 https://github.com/ageitgey/face_recognition/blob/master/examples/find_faces_in_picture.py
识别照片中的面部特征Identify specific facial features in a photograph https://github.com/ageitgey/face_recognition/blob/master/examples/find_facial_features_in_picture.py
使用数字美颜Apply (horribly ugly) digital make-up https://github.com/ageitgey/face_recognition/blob/master/examples/digital_makeup.py
基于已知人名找到并识别出照片中的未知人脸Find and recognize unknown faces in a photograph based on photographs of known people https://github.com/ageitgey/face_recognition/blob/master/examples/recognize_faces_in_pictures.py
人脸识别方法的原理
如果你想学习此方法的人脸定位和识别原理,请参见read my article。 https://medium.com/@ageitgey/machine-learning-is-fun-part-4-modern-face-recognition-with-deep-learning-c3cffc121d78
注意事项
· 本人脸识别模型仅限用于成人,对于儿童来说效果不佳,模型可能会由于使用默认的对比阈值(0.6)而无法清楚识别出儿童的脸。
dlib 文档
opencv文档
中文网:http://www.opencv.org.cn/
face_recognition文档,源码 https://facerecognition.readthedocs.io/en/latest/face_recognition.html face_recognition --tolerance 0.54 /home/double/dlib_data/train/ /home/double/dlib_data/test/
文件夹前面没有点
模型使用了C++工具箱dlib基于深度学习的最新人脸识别方法,基于户外脸部数据测试库Labeled Faces in the Wild 的基准水平来说,达到了99.38%的准确率。
dlib:http://dlib.net/
数据测试库Labeled Faces in the Wild:http://vis-www.cs.umass.edu/lfw/
模型提供了一个简单的 face_recognition 命令行工具让用户通过命令就能直接使用图片文件夹进行人脸识别操作。
安装
pip3 install face_recognition
如果报错:ubuntu下安装dlib,http://blog.csdn.net/funny75/article/details/51582056
dlib官网 http://dlib.net/compile.html 进入官网下载安装包,解压后放到 /usr/local/lib/python2.7/dist-packages 目录下(或者3.5,根据自己的python版本选择)
安装编译所需工具
sudo apt-get install cmake
(如果报错:软件包 cmake 没有可安装候选,先sudo apt-get update)
sudo apt-get install libboost-python-dev
进入dlib的目录
sudo python3 setup.py install
(如果发生错误:python-3-importerror-no-module-named-setuptools,先对于Python 3. x
sudo apt-get install python3-setuptools)
(如果发生错误:/usr/local/lib/python3.5/dist-packages/dlib-19.10/dlib/external/pybind11/include/pybind11/detail/common.h:111:20: fatal error: Python.h: 没有那个文件或目录:那么:sudo apt install python3.5-dev)
然后再 运行pip3 install face_recognition来完成安装。
测试:
接下来你只用运行face_recognition命令,程序能够通过已知人脸的文件夹识别出未知人脸照片中的人是谁;
针对每个人脸都要一行输出,数据是文件名加上识别到的人名,以逗号分隔。
如果你只是想要知道每个照片中的人名而不要文件名,可以进行如下操作:
Python模块,实现人脸识别
你可以通过引入face_recognition就能完成人脸识别操作:
API 文档: https://face-recognition.readthedocs.io.
在图片中自动识别所有人脸
请参照此案例: https://github.com/ageitgey/face_recognition/blob/master/examples/find_faces_in_picture.py
识别图片中的人脸并告知姓名
请参照此案例this example: https://github.com/ageitgey/face_recognition/blob/master/examples/recognize_faces_in_pictures.py
Python代码案例
所有例子在此 here. https://github.com/ageitgey/face_recognition/tree/master/examples
找到照片中的人脸 https://github.com/ageitgey/face_recognition/blob/master/examples/find_faces_in_picture.py
识别照片中的面部特征Identify specific facial features in a photograph https://github.com/ageitgey/face_recognition/blob/master/examples/find_facial_features_in_picture.py
使用数字美颜Apply (horribly ugly) digital make-up https://github.com/ageitgey/face_recognition/blob/master/examples/digital_makeup.py
基于已知人名找到并识别出照片中的未知人脸Find and recognize unknown faces in a photograph based on photographs of known people https://github.com/ageitgey/face_recognition/blob/master/examples/recognize_faces_in_pictures.py
人脸识别方法的原理
如果你想学习此方法的人脸定位和识别原理,请参见read my article。 https://medium.com/@ageitgey/machine-learning-is-fun-part-4-modern-face-recognition-with-deep-learning-c3cffc121d78
注意事项
· 本人脸识别模型仅限用于成人,对于儿童来说效果不佳,模型可能会由于使用默认的对比阈值(0.6)而无法清楚识别出儿童的脸。
dlib 文档
opencv文档
中文网:http://www.opencv.org.cn/
face_recognition文档,源码 https://facerecognition.readthedocs.io/en/latest/face_recognition.html face_recognition --tolerance 0.54 /home/double/dlib_data/train/ /home/double/dlib_data/test/
文件夹前面没有点
相关文章推荐
- 基于Python使用CloudSight API实现简单的图像识别(image Recognition)
- AngularJS+RestfulAPI+BasicAuth+Python/PHP/Node.JS来实现一个最简单的新闻管理后台
- python下以api形式调用tesseract识别图片验证码
- sigar模块之python api简单的使用--获取cpu信息
- python 命令行套件 & mesos http-api调用
- 图像识别 python+opencv的简单人脸识别
- python字符串编码识别模块chardet简单应用
- python MNIST手写识别数据调用API的方法
- iOS 7新的API允许拍照类应用自动识别用户面部表情
- 用Python进行简单图像识别(验证码)
- 关于 Maya Python API 中的简单类型的一些问题
- Python3使用微软人脸API-1.2创建人员组人员训练识别
- MNIST手写识别数据调用API(python)
- eoLinker-API_Shop_验证码识别与生成类API调用的代码示例合集:六位图片验证码生成、四位图片验证码生成、简单验证码识别等
- kNN算法python实现和简单数字识别
- Python验证码识别:利用pytesser识别简单图形验证码
- python下以api形式调用tesseract识别图片验证码
- 用Python识别简单验证码
- python pyaudio 百度语音识别api 图灵api 语音聊天机器人
- python 调用图灵机器人api实现简单的人机交互