Face Recognition 人脸识别

本项目face_recognition是一个强大、简单、易上手的人脸识别开源项目,并且配备了完整的开发文档和应用案例,特别是兼容树莓派系统。

为了便于中国开发者研究学习人脸识别、贡献代码,我将本项目README文件翻译成中文。

向本项目的所有贡献者致敬。

英译汉:同济大学开源软件协会 子豪兄Tommy

Translator's note:

face_recognition is a powerful, simple and easy-to-use face recognition open source project with complete development documents and application cases, especially it is compatible with Raspberry Pi.

In order to facilitate Chinese software developers to learn, make progress in face recognition development and source code contributions, I translated README file into simplified Chinese.

Salute to all contributors to this project.

Translator: Tommy in Tongji Univerisity Opensource Association 子豪兄Tommy

本项目是世界上最简洁的人脸识别库,你可以使用Python和命令行工具提取、识别、操作人脸。

本项目的人脸识别是基于业内领先的C++开源库 dlib中的深度学习模型,用Labeled Faces in the Wild人脸数据集进行测试,有高达99.38%的准确率。但对小孩和亚洲人脸的识别准确率尚待提升。

Labeled Faces in the Wild是美国麻省大学安姆斯特分校(University of Massachusetts Amherst)制作的人脸数据集,该数据集包含了从网络收集的13,000多张面部图像。

本项目提供了简易的face_recognition命令行工具,你可以用它处理整个文件夹里的图片。

PyPI Build Status Documentation Status

特性

从图片里找到人脸

定位图片中的所有人脸:

import face_recognition
image = face_recognition.load_image_file("your_file.jpg")
face_locations = face_recognition.face_locations(image)

识别人脸关键点

识别人脸关键点,包括眼睛、鼻子、嘴和下巴。

import face_recognition
image = face_recognition.load_image_file("your_file.jpg")
face_landmarks_list = face_recognition.face_landmarks(image)

识别人脸关键点在很多领域都有用处,但同样你也可以把这个功能玩坏,比如本项目的 digital make-up自动化妆案例(就像美图秀秀一样)。

识别图片中的人是谁

import face_recognition
known_image = face_recognition.load_image_file("biden.jpg")
unknown_image = face_recognition.load_image_file("unknown.jpg")

biden_encoding = face_recognition.face_encodings(known_image)[0]
unknown_encoding = face_recognition.face_encodings(unknown_image)[0]

results = face_recognition.compare_faces([biden_encoding], unknown_encoding)

你也可以配合其它的Python库(比如opencv)实现实时人脸检测:

看这个案例 实时人脸检测 。

安装

环境配置

  • Python 3.3+ or Python 2.7
  • macOS or Linux
  • Windows并不是我们官方支持的,但也许也能用

不同操作系统的安装方法

在 Mac 或者 Linux上安装本项目

First, make sure you have dlib already installed with Python bindings:

第一步,安装dlib和相关Python依赖:

Then, install this module from pypi using pip3 (or pip2 for Python 2):

pip3 install face_recognition
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

AI周红伟

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值