mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 12:05:22 +00:00
Face alignment with rotation using resample
This commit is contained in:
parent
f3f9e3d3ab
commit
4ffbc8ec75
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user