mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 20:15:21 +00:00
issue 309 - lfw with detectors
This commit is contained in:
parent
98c434e275
commit
885f89dd52
@ -93,7 +93,10 @@ def detect_face(img, detector_backend = 'opencv', grayscale = False, enforce_det
|
|||||||
#it will not build face detector model in each call (consider for loops)
|
#it will not build face detector model in each call (consider for loops)
|
||||||
face_detector = FaceDetector.build_model(detector_backend)
|
face_detector = FaceDetector.build_model(detector_backend)
|
||||||
|
|
||||||
detected_face, img_region = FaceDetector.detect_face(face_detector, detector_backend, img, align)
|
try:
|
||||||
|
detected_face, img_region = FaceDetector.detect_face(face_detector, detector_backend, img, align)
|
||||||
|
except: #if detected face shape is (0, 0) and alignment cannot be performed, this block will be run
|
||||||
|
detected_face = None
|
||||||
|
|
||||||
if (isinstance(detected_face, np.ndarray)):
|
if (isinstance(detected_face, np.ndarray)):
|
||||||
return detected_face, img_region
|
return detected_face, img_region
|
||||||
|
Loading…
x
Reference in New Issue
Block a user