diff --git a/deepface/detectors/OpenCv.py b/deepface/detectors/OpenCv.py index cf0e8d7..15bdcf3 100644 --- a/deepface/detectors/OpenCv.py +++ b/deepface/detectors/OpenCv.py @@ -53,6 +53,12 @@ class OpenCvClient(Detector): for (x, y, w, h), confidence in zip(faces, scores): detected_face = img[int(y) : int(y + h), int(x) : int(x + w)] left_eye, right_eye = self.find_eyes(img=detected_face) + + # eyes found in the detected face instead image itself + # detected face's coordinates should be added + left_eye = (x + left_eye[0], y + left_eye[1]) + right_eye = (x + right_eye[0], y + right_eye[1]) + facial_area = FacialAreaRegion( x=x, y=y, diff --git a/deepface/detectors/Ssd.py b/deepface/detectors/Ssd.py index f21d44c..b427b4d 100644 --- a/deepface/detectors/Ssd.py +++ b/deepface/detectors/Ssd.py @@ -132,6 +132,11 @@ class SsdClient(Detector): left_eye, right_eye = opencv_module.find_eyes(detected_face) + # eyes found in the detected face instead image itself + # detected face's coordinates should be added + left_eye = (x + left_eye[0], y + left_eye[1]) + right_eye = (x + right_eye[0], y + right_eye[1]) + facial_area = FacialAreaRegion( x=x, y=y,