mirror of
https://github.com/serengil/deepface.git
synced 2025-06-06 11:35:21 +00:00
Use original utralytics module for YOLO.
This commit is contained in:
parent
0b8e5ca472
commit
80d4dbb64e
@ -48,15 +48,17 @@ def detect_face(face_detector, img, align=False):
|
|||||||
detected_face = img[y: y + h, x: x + w].copy()
|
detected_face = img[y: y + h, x: x + w].copy()
|
||||||
|
|
||||||
if align:
|
if align:
|
||||||
# Extract landmarks
|
# Tuple of x,y and confidence for left eye
|
||||||
left_eye, right_eye, _, _, _ = result.keypoints.tolist()
|
left_eye = result.keypoints.xy[0][0], result.keypoints.conf[0][0]
|
||||||
# Check the landmarks confidence before alignment
|
# Tuple of x,y and confidence for right eye
|
||||||
if (left_eye[2] > LANDMARKS_CONFIDENCE_THRESHOLD and
|
right_eye = result.keypoints.xy[0][1], result.keypoints.conf[0][1]
|
||||||
right_eye[2] > LANDMARKS_CONFIDENCE_THRESHOLD):
|
|
||||||
detected_face = FaceDetector.alignment_procedure(
|
|
||||||
detected_face, left_eye[:2], right_eye[:2]
|
|
||||||
)
|
|
||||||
|
|
||||||
|
# Check the landmarks confidence before alignment
|
||||||
|
if (left_eye[1] > LANDMARKS_CONFIDENCE_THRESHOLD and
|
||||||
|
right_eye[1] > LANDMARKS_CONFIDENCE_THRESHOLD):
|
||||||
|
detected_face = FaceDetector.alignment_procedure(
|
||||||
|
detected_face, left_eye[0].cpu(), right_eye[0].cpu()
|
||||||
|
)
|
||||||
resp.append((detected_face, [x, y, w, h], confidence))
|
resp.append((detected_face, [x, y, w, h], confidence))
|
||||||
|
|
||||||
return resp
|
return resp
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
opencv-contrib-python>=4.3.0.36
|
opencv-contrib-python>=4.3.0.36
|
||||||
mediapipe>=0.8.7.3
|
mediapipe>=0.8.7.3
|
||||||
dlib>=19.20.0
|
dlib>=19.20.0
|
||||||
ultralytics @ git+https://github.com/derronqi/yolov8-face.git@b623989575bdb78601b5ca717851e3d63ca9e01c
|
ultralytics>=8.0.122
|
Loading…
x
Reference in New Issue
Block a user