Skip to content

Commit

Permalink
Add some comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent-Stragier committed Jun 5, 2023
1 parent 907db28 commit c96a2e4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion deepface/detectors/MediapipeWrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ def detect_face(face_detector, img, align=True):

results = face_detector.process(img)

# if no face have been detected, return an empty list
# If no face has been detected, return an empty list
if results.detections is None:
return resp

# Extract the bounding box, the landmarks and the confidence score
for detection in results.detections:
(confidence,) = detection.score

Expand All @@ -34,6 +35,7 @@ def detect_face(face_detector, img, align=True):
y = int(bounding_box.ymin * img_height)
h = int(bounding_box.height * img_height)

# Extract landmarks
left_eye = (int(landmarks[0].x * img_width), int(landmarks[0].y * img_height))
right_eye = (int(landmarks[1].x * img_width), int(landmarks[1].y * img_height))
# nose = (int(landmarks[2].x * img_width), int(landmarks[2].y * img_height))
Expand Down

0 comments on commit c96a2e4

Please sign in to comment.