diff --git a/deepface/modules/detection.py b/deepface/modules/detection.py index e3042e4..6089443 100644 --- a/deepface/modules/detection.py +++ b/deepface/modules/detection.py @@ -201,8 +201,8 @@ def align_face( Align a given image horizantally with respect to their left and right eye locations Args: img (np.ndarray): pre-loaded image with detected face - left_eye (list or tuple): coordinates of left eye with respect to the you - right_eye(list or tuple): coordinates of right eye with respect to the you + left_eye (list or tuple): coordinates of left eye with respect to the person itself + right_eye(list or tuple): coordinates of right eye with respect to the person itself Returns: img (np.ndarray): aligned facial image """ @@ -214,6 +214,6 @@ def align_face( if img.shape[0] == 0 or img.shape[1] == 0: return img, 0 - angle = float(np.degrees(np.arctan2(right_eye[1] - left_eye[1], right_eye[0] - left_eye[0]))) + angle = float(np.degrees(np.arctan2(left_eye[1] - right_eye[1], left_eye[0] - right_eye[0]))) img = np.array(Image.fromarray(img).rotate(angle)) return img, angle