Face alignment with rotation using resample

This commit is contained in:
Student B 2024-07-03 16:46:57 +03:00 committed by GitHub
parent f3f9e3d3ab
commit 4ffbc8ec75
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
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