【问题标题】:How to use DeepFace.detectFace() to actually detect a several faces in an image?如何使用 DeepFace.detectFace() 实际检测图像中的多个人脸?
【发布时间】:2021-11-13 02:42:13
【问题描述】:

我正在使用深度人脸库来在一张图片中获取多个人脸,DeepFace.detectFace(),只检测一张人脸,但是如果我单独使用后端而不使用 DeepFace,我可以提取所有人脸,是否可以使用 DeepFace.detectFace() 来获取一张照片中的所有面孔?

谢谢

【问题讨论】:

    标签: python image-processing face-detection deepface


    【解决方案1】:

    DeepFace 希望您使用一张人脸提供图像。您仍然可以使用 deepface 提取人脸。

    from deepface.detectors import FaceDetector
    import cv2
    
    img_path = "couple.jpg"
    detector_name = "opencv"
    
    img = cv2.imread(img_path)
    
    detector = FaceDetector.build_model(detector_name) #set opencv, ssd, dlib, mtcnn or retinaface
    
    obj = FaceDetector.detect_faces(detector, detector_name, img)
    
    print("there are ",len(obj)," faces")
    

    【讨论】:

      猜你喜欢
      • 2020-12-07
      • 2019-12-01
      • 2021-01-15
      • 2017-06-01
      • 2019-10-11
      • 2020-08-24
      • 2018-10-26
      • 2021-06-26
      • 2012-11-17
      相关资源
      最近更新 更多