Merge pull request #1269 from mowshon/master

Face alignment with rotation using resample
This commit is contained in:
Sefik Ilkin Serengil 2024-07-03 15:44:32 +01:00 committed by GitHub
commit 1fcd8c6594
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -177,5 +177,5 @@ def align_face(
return img, 0 return img, 0
angle = float(np.degrees(np.arctan2(left_eye[1] - right_eye[1], left_eye[0] - right_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)) img = np.array(Image.fromarray(img).rotate(angle, resample=Image.BICUBIC))
return img, angle return img, angle