Skip to content
Snippets Groups Projects
Commit 07aae998 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Handle cases when face is not detected

parent 05251c39
No related branches found
No related tags found
1 merge request!10Handle cases when face is not detected
Pipeline #
...@@ -52,10 +52,12 @@ class DlibLandmarkExtraction(object): ...@@ -52,10 +52,12 @@ class DlibLandmarkExtraction(object):
# Detecting the face if the bounding box is not passed # Detecting the face if the bounding box is not passed
if bb is None: if bb is None:
bb = bounding_box_2_rectangle(self.face_detector.detect_single_face(image)[0]) bb = self.face_detector.detect_single_face(image)
if bb is None: if bb is None:
return None return None
bb = bounding_box_2_rectangle(bb[0])
else: else:
bb = bounding_box_2_rectangle(bb) bb = bounding_box_2_rectangle(bb)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment