aryrk commited on
Commit
60c5500
·
1 Parent(s): 7bd8b18

[feat] resize output image to match input dimension

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -96,6 +96,11 @@ def reflection_removal(input_image, preprocess_type="resize_and_crop"):
96
  if file.startswith(input_filename) and file.endswith("_fake.png"):
97
  result_path = os.path.join(root, file)
98
  output_image = Image.open(result_path)
 
 
 
 
 
99
  os.remove(result_path)
100
  elif file.startswith(input_filename) and file.endswith("_real.png"):
101
  real_path = os.path.join(root, file)
 
96
  if file.startswith(input_filename) and file.endswith("_fake.png"):
97
  result_path = os.path.join(root, file)
98
  output_image = Image.open(result_path)
99
+
100
+ if preprocess_type not in ["crop", "none"]:
101
+ input_image = Image.open(input_image)
102
+ output_image = output_image.resize(input_image.size)
103
+
104
  os.remove(result_path)
105
  elif file.startswith(input_filename) and file.endswith("_real.png"):
106
  real_path = os.path.join(root, file)