Skip to content

Commit

Permalink
issue 309 - lfw with detectors
Browse files Browse the repository at this point in the history
  • Loading branch information
serengil committed Aug 19, 2021
1 parent 98c434e commit 885f89d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion deepface/commons/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
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)):
return detected_face, img_region
Expand Down

0 comments on commit 885f89d

Please sign in to comment.