可以行使深度进修模子以到达越发精准的人脸定位,但要留意:这种要领必要GPU加快(通过英伟达显卡的CUDA库驱动),在编译安装dlib的时辰也必要开启CUDA支持。
- import face_recognition
- image = face_recognition.load_image_file("my_picture.jpg")
- face_locations = face_recognition.face_locations(image, model="cnn")
- # 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
怎样辨认单张图片中人脸的要害点?
- import face_recognition
- image = face_recognition.load_image_file("my_picture.jpg")
- face_landmarks_list = face_recognition.face_landmarks(image)
- # face_landmarks_list is now an array with the locations of each facial feature in each face.
- # 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
辨认奥巴马和拜登的人脸要害点
更多案例:
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)
(编辑:湖南网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|