首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在face_recognition中使用yolov4人脸检测

问在face_recognition中使用yolov4人脸检测
EN

Stack Overflow用户
提问于 2020-11-02 23:07:32
回答 1查看 1.3K关注 0票数 0

我是否可以使用yolov4进行对象检测并使用face_recognition库来识别检测到的人脸,或者我是否需要使用face_recognition库提供的人脸检测才能使用其人脸识别?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-11-03 01:10:39

face_recognition库使用dlib专用于人脸检测的内置算法。它声称精度为99%+。您不能将该算法更改为YoloV4或任何其他算法。

face_recognition的网络架构基于ResNet-34,但层更少,过滤器的数量减少了一半。该网络是在一个包含300万张图像的数据集上进行训练的,这些图像来自野外(LFW)数据集中经过标记的人脸。

看看戴维斯·金(dlib的创建者)和Adam Geitgey (face_recognition的作者)关于基于深度学习的面部识别如何工作的文章:

High Quality Face Recognition with Deep Metric Learning

Modern Face Recognition with Deep Learning

但是,如果这还不足以满足您的情况,您可以训练YoloV4来检测人脸,然后在检测之后,裁剪该人脸并将其作为输入提供给face_recognition库。

代码语言:javascript
复制
import face_recognition

picture_of_me = face_recognition.load_image_file("me.jpg")
my_face_encoding = face_recognition.face_encodings(picture_of_me)[0]

# my_face_encoding now contains a universal 'encoding' of my facial features that can be compared to any other picture of a face!

unknown_picture = face_recognition.load_image_file("unknown.jpg")
unknown_face_encoding = face_recognition.face_encodings(unknown_picture)[0]

# Now we can see the two face encodings are of the same person with `compare_faces`!

results = face_recognition.compare_faces([my_face_encoding], unknown_face_encoding)

if results[0] == True:
    print("It's a picture of me!")
else:
    print("It's not a picture of me!")
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64648078

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档