mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 12:05:22 +00:00
exception handling in case of yolo has no keypoints
This commit is contained in:
parent
42e911958b
commit
e67614ff7a
@ -73,10 +73,17 @@ class YoloClient(Detector):
|
|||||||
|
|
||||||
# For each face, extract the bounding box, the landmarks and confidence
|
# For each face, extract the bounding box, the landmarks and confidence
|
||||||
for result in results:
|
for result in results:
|
||||||
|
|
||||||
|
if result.boxes is None:
|
||||||
|
continue
|
||||||
|
|
||||||
# Extract the bounding box and the confidence
|
# Extract the bounding box and the confidence
|
||||||
x, y, w, h = result.boxes.xywh.tolist()[0]
|
x, y, w, h = result.boxes.xywh.tolist()[0]
|
||||||
confidence = result.boxes.conf.tolist()[0]
|
confidence = result.boxes.conf.tolist()[0]
|
||||||
|
|
||||||
|
if result.keypoints is None:
|
||||||
|
continue
|
||||||
|
|
||||||
# left_eye_conf = result.keypoints.conf[0][0]
|
# left_eye_conf = result.keypoints.conf[0][0]
|
||||||
# right_eye_conf = result.keypoints.conf[0][1]
|
# right_eye_conf = result.keypoints.conf[0][1]
|
||||||
left_eye = result.keypoints.xy[0][0].tolist()
|
left_eye = result.keypoints.xy[0][0].tolist()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user