Added Lanczos to warpAffine

This commit is contained in:
David Chatel
2025-02-11 17:15:48 +01:00
parent 7176d84c5e
commit dfa90ae487
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -119,7 +119,7 @@ class Face:
T3 = np.array([[1, 0, -cx], [0, 1, -cy], [0, 0, 1]])
T4 = np.array([[1, 0, cx], [0, 1, cy], [0, 0, 1]])
N = N @ T4 @ S @ T3
crop = cv2.warpAffine(self.img.numpy(), N, (size, size))
crop = cv2.warpAffine(self.img.numpy(), N, (size, size), flags=cv2.INTER_LANCZOS4)
crop = torch.from_numpy(crop)[None]
return N, crop