mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 03:55:21 +00:00
nose and mouth unavailable case covered
This commit is contained in:
parent
f7eb2d7873
commit
0ec185721e
@ -42,16 +42,19 @@ class RetinaFaceClient(Detector):
|
|||||||
# retinaface sets left and right eyes with respect to the person
|
# retinaface sets left and right eyes with respect to the person
|
||||||
left_eye = identity["landmarks"]["left_eye"]
|
left_eye = identity["landmarks"]["left_eye"]
|
||||||
right_eye = identity["landmarks"]["right_eye"]
|
right_eye = identity["landmarks"]["right_eye"]
|
||||||
nose = identity["landmarks"]["nose"]
|
nose = identity["landmarks"].get("nose")
|
||||||
mouth_right = identity["landmarks"]["mouth_right"]
|
mouth_right = identity["landmarks"].get("mouth_right")
|
||||||
mouth_left = identity["landmarks"]["mouth_left"]
|
mouth_left = identity["landmarks"].get("mouth_left")
|
||||||
|
|
||||||
# eyes are list of float, need to cast them tuple of int
|
# eyes are list of float, need to cast them tuple of int
|
||||||
left_eye = tuple(int(i) for i in left_eye)
|
left_eye = tuple(int(i) for i in left_eye)
|
||||||
right_eye = tuple(int(i) for i in right_eye)
|
right_eye = tuple(int(i) for i in right_eye)
|
||||||
nose = tuple(int(i) for i in nose)
|
if nose is not None:
|
||||||
mouth_right = tuple(int(i) for i in mouth_right)
|
nose = tuple(int(i) for i in nose)
|
||||||
mouth_left = tuple(int(i) for i in mouth_left)
|
if mouth_right is not None:
|
||||||
|
mouth_right = tuple(int(i) for i in mouth_right)
|
||||||
|
if mouth_left is not None:
|
||||||
|
mouth_left = tuple(int(i) for i in mouth_left)
|
||||||
|
|
||||||
confidence = identity["score"]
|
confidence = identity["score"]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user