加入收藏 | 设为首页 | 会员中心 | 我要投稿 应用网_丽江站长网 (http://www.0888zz.com/)- 科技、建站、数据工具、云上网络、机器学习!
当前位置: 首页 > 运营中心 > 建站资源 > 经验 > 正文

超简单而强大的人脸识别项目登上GitHub趋势榜

发布时间:2019-08-14 01:27:45 所属栏目:经验 来源:TommyZihao编译
导读:副标题#e# 近日,一个名为 face_recognition 的人脸识别项目登上了 GitHub Trending 趋势榜,赚足了眼球。自开源至截稿,此项目在 Github 上的 Star 数已达 26500,Fork 数也达到了 7117。本文主要介绍了该项目的使用说明和使用方法,便于国内的开发者们进

可以使用深度学习模型以达到更加精准的人脸定位,但要注意:这种方法需要GPU加速(通过英伟达显卡的CUDA库驱动),在编译安装dlib的时候也需要开启CUDA支持。

  1. import face_recognition 
  2. image = face_recognition.load_image_file("my_picture.jpg") 
  3. face_locations = face_recognition.face_locations(image, model="cnn") 
  4. # face_locations is now an array listing the co-ordinates of each face 

参考案例:

https://github.com/ageitgey/face_recognition/blob/master/examples/find_faces_in_picture_cnn.py

如果有大量图片需要识别,同时又有GPU,那么你可以参考这个例子:

https://github.com/ageitgey/face_recognition/blob/master/examples/find_faces_in_batches.py

如何识别单张图片中人脸的关键点?

  1. import face_recognition 
  2. image = face_recognition.load_image_file("my_picture.jpg") 
  3. face_landmarks_list = face_recognition.face_landmarks(image) 
  4. # face_landmarks_list is now an array with the locations of each facial feature in each face. 
  5. # face_landmarks_list[0]['left_eye'] would be the location and outline of the first person's left eye 

参考案例:

https://github.com/ageitgey/face_recognition/blob/master/examples/find_facial_features_in_picture.py

史上最简单的人脸识别项目登上GitHub趋势榜

识别奥巴马和拜登的人脸关键点

更多案例:

https://github.com/ageitgey/face_recognition/tree/master/examples

人脸定位

案例:定位拜登的脸

https://github.com/ageitgey/face_recognition/blob/master/examples/find_faces_in_picture_cnn.py

案例:使用卷积神经网络深度学习模型定位拜登的脸

https://github.com/ageitgey/face_recognition/blob/master/examples/find_faces_in_picture_cnn.py

案例:使用卷积神经网络深度学习模型批量识别图片中的人脸

https://github.com/ageitgey/face_recognition/blob/master/examples/find_faces_in_batches.py

案例:把来自网络摄像头视频里的人脸高斯模糊(需要安装OpenCV)

https://github.com/ageitgey/face_recognition/blob/master/examples/blur_faces_on_webcam.py

人脸关键点识别

案例:提取奥巴马和拜登的面部关键点

https://github.com/ageitgey/face_recognition/blob/master/examples/find_facial_features_in_picture.py

案例:给美国副总统拜登涂美妆

https://github.com/ageitgey/face_recognition/blob/master/examples/digital_makeup.py

人脸识别

案例:是奥巴马还是拜登?

https://github.com/ageitgey/face_recognition/blob/master/examples/recognize_faces_in_pictures.py

案例:人脸识别之后在原图上画框框并标注姓名

https://github.com/ageitgey/face_recognition/blob/master/examples/identify_and_draw_boxes_on_faces.py

案例:在不同精度上比较两个人脸是否属于一个人

https://github.com/ageitgey/face_recognition/blob/master/examples/face_distance.py

案例:从摄像头获取视频进行人脸识别-较慢版(需要安装OpenCV)

https://github.com/ageitgey/face_recognition/blob/master/examples/facerec_from_webcam.py

  • 案例:从摄像头获取视频进行人脸识别-较快版(需要安装OpenCV)

(编辑:应用网_丽江站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读