alexnasa commited on
Commit
80bb1dc
·
verified ·
1 Parent(s): d409962

Update inference_coz.py

Browse files
Files changed (1) hide show
  1. inference_coz.py +3 -2
inference_coz.py CHANGED
@@ -311,12 +311,13 @@ if __name__ == "__main__":
311
  elif args.rec_type == 'recursive_multiscale':
312
  prev_sr_output_path = f'{rec_dir}/{rec}.png'
313
  prev_sr_output_pil = Image.open(prev_sr_output_path).convert('RGB')
 
 
 
314
  if rscale != 0:
315
  new_w, new_h = w // rscale, h // rscale
316
  else:
317
  new_w, new_h = w, h
318
- w, h = prev_sr_output_pil.size
319
- new_w, new_h = w // rscale, h // rscale
320
  cropped_region = prev_sr_output_pil.crop(((w-new_w)//2, (h-new_h)//2, (w+new_w)//2, (h+new_h)//2))
321
  current_sr_input_image_pil = cropped_region.resize((w, h), Image.BICUBIC)
322
 
 
311
  elif args.rec_type == 'recursive_multiscale':
312
  prev_sr_output_path = f'{rec_dir}/{rec}.png'
313
  prev_sr_output_pil = Image.open(prev_sr_output_path).convert('RGB')
314
+ rscale = args.upscale
315
+ w, h = prev_sr_output_pil.size
316
+
317
  if rscale != 0:
318
  new_w, new_h = w // rscale, h // rscale
319
  else:
320
  new_w, new_h = w, h
 
 
321
  cropped_region = prev_sr_output_pil.crop(((w-new_w)//2, (h-new_h)//2, (w+new_w)//2, (h+new_h)//2))
322
  current_sr_input_image_pil = cropped_region.resize((w, h), Image.BICUBIC)
323