From 522d3709033d7cb92f95f51c798ce051e1ef1dde Mon Sep 17 00:00:00 2001 From: Mukund Tiwari <88654449+mukund-tiwari@users.noreply.github.com> Date: Tue, 3 Dec 2024 15:38:17 +0530 Subject: [PATCH] Update crop_align_face.py to use PIL.Image.LANCZOS Updated crop_align_face.py to use PIL.Image.LANCZOS instead of PIL.Image.ANTIALIAS as it is deprecated and does not work anymore. --- scripts/crop_align_face.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/crop_align_face.py b/scripts/crop_align_face.py index c44d6e8f..2f6e88a2 100755 --- a/scripts/crop_align_face.py +++ b/scripts/crop_align_face.py @@ -174,7 +174,7 @@ def align_face(filepath, out_path): (quad + 0.5).flatten(), PIL.Image.BILINEAR) if output_size < transform_size: - img = img.resize((output_size, output_size), PIL.Image.ANTIALIAS) + img = img.resize((output_size, output_size), PIL.Image.LANCZOS) # Save aligned image. # print('saveing: ', out_path) @@ -202,4 +202,4 @@ def align_face(filepath, out_path): print(f'[{i+1}/{test_img_num}] Processing: {img_name}') out_path = os.path.join(args.out_dir, in_path.split("/")[-1]) out_path = out_path.replace('.jpg', '.png') - size_ = align_face(in_path, out_path) \ No newline at end of file + size_ = align_face(in_path, out_path)