eyes can be none

This commit is contained in:
Sefik Ilkin Serengil 2024-03-19 08:53:40 +00:00
parent 71bea587da
commit 87a95dc2ae
2 changed files with 8 additions and 4 deletions

View File

@ -56,7 +56,9 @@ class OpenCvClient(Detector):
# eyes found in the detected face instead image itself # eyes found in the detected face instead image itself
# detected face's coordinates should be added # detected face's coordinates should be added
if left_eye is not None:
left_eye = (x + left_eye[0], y + left_eye[1]) left_eye = (x + left_eye[0], y + left_eye[1])
if right_eye is not None:
right_eye = (x + right_eye[0], y + right_eye[1]) right_eye = (x + right_eye[0], y + right_eye[1])
facial_area = FacialAreaRegion( facial_area = FacialAreaRegion(

View File

@ -134,7 +134,9 @@ class SsdClient(Detector):
# eyes found in the detected face instead image itself # eyes found in the detected face instead image itself
# detected face's coordinates should be added # detected face's coordinates should be added
if left_eye is not None:
left_eye = (x + left_eye[0], y + left_eye[1]) left_eye = (x + left_eye[0], y + left_eye[1])
if right_eye is not None:
right_eye = (x + right_eye[0], y + right_eye[1]) right_eye = (x + right_eye[0], y + right_eye[1])
facial_area = FacialAreaRegion( facial_area = FacialAreaRegion(