Commit 7a5f8d70 authored by zycXD's avatar zycXD
Browse files

fix bugs

parent c8c37dbd
...@@ -174,13 +174,14 @@ def main() -> None: ...@@ -174,13 +174,14 @@ def main() -> None:
save_restore_path = os.path.join(parent_path, 'restored_faces', save_face_name) save_restore_path = os.path.join(parent_path, 'restored_faces', save_face_name)
Image.fromarray(restored_face).save(save_restore_path) Image.fromarray(restored_face).save(save_restore_path)
# remove padding if not args.has_aligned:
restored_img = restored_img[:lq_resized.height, :lq_resized.width, :] # remove padding
# save restored image restored_img = restored_img[:lq_resized.height, :lq_resized.width, :]
if args.resize_back and lq_resized.size != lq.size: # save restored image
Image.fromarray(restored_img).resize(lq.size, Image.LANCZOS).convert("RGB").save(restored_img_path) if args.resize_back and lq_resized.size != lq.size:
else: Image.fromarray(restored_img).resize(lq.size, Image.LANCZOS).convert("RGB").save(restored_img_path)
Image.fromarray(restored_img).convert("RGB").save(restored_img_path) else:
Image.fromarray(restored_img).convert("RGB").save(restored_img_path)
print(f"Face image {basename} saved to {parent_path}") print(f"Face image {basename} saved to {parent_path}")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment