mirror of
https://github.com/serengil/deepface.git
synced 2025-06-08 20:45:22 +00:00
issue 1123 resolved
for opencv and ssd, we were finding eyes from the detected faces. that is why, eye coordinates were inccorrect with respect to the image itself. we added the x and y coordinates of the detected face into the eye coordinates.
This commit is contained in:
parent
22eebc0a01
commit
2cbfc417a4
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user