【问题标题】:use yolov4 face detection with face_recognition使用 yolov4 人脸检测和 face_recognition
【发布时间】:2021-02-15 06:13:26
【问题描述】:

是否可以使用yolov4进行物体检测并使用face_recognition库识别检测到的人脸,还是需要使用face_recognition库提供的人脸检测才能使用其人脸识别?

【问题讨论】:

    标签: deep-learning computer-vision object-detection face-detection dlib


    【解决方案1】:

    face_recognition 库使用dlib 的特定于面部检测的内置算法。它声称的准确率是 99%+。您不能将该算法更改为 YoloV4 或任何其他算法。

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

    查看 Davis King(dlib 的创建者)和 Adam Geitgey(face_recognition 的作者)关于基于深度学习的面部识别如何工作的文章:

    High Quality Face Recognition with Deep Metric Learning

    Modern Face Recognition with Deep Learning

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

    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!")
    

    【讨论】:

      猜你喜欢
      • 2017-06-01
      • 2019-11-18
      • 2020-10-24
      • 1970-01-01
      • 2013-09-24
      • 2017-07-30
      • 2020-06-28
      • 2019-12-01
      • 2017-10-18
      相关资源
      最近更新 更多