LPDoctor commited on
Commit
4046cf6
β€’
1 Parent(s): f209e6c

sync the output size as same as input

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -129,6 +129,8 @@ def start_tryon(dict,garm_img,garment_des,is_checked,is_checked_crop,denoise_ste
129
  pipe.to(device)
130
  pipe.unet_encoder.to(device)
131
 
 
 
132
  garm_img= garm_img.convert("RGB").resize((768,1024))
133
 
134
  human_img_orig = dict.convert("RGB").resize((768,1024))
@@ -238,9 +240,9 @@ def start_tryon(dict,garm_img,garment_des,is_checked,is_checked_crop,denoise_ste
238
  if is_checked_crop:
239
  out_img = images[0].resize(crop_size)
240
  human_img_orig.paste(out_img, (int(left), int(top)))
241
- return human_img_orig
242
  else:
243
- return images[0]
244
  # return images[0], mask_gray
245
 
246
  garm_list = os.listdir(os.path.join(example_path,"cloth"))
 
129
  pipe.to(device)
130
  pipe.unet_encoder.to(device)
131
 
132
+ OUTPUT_WIDTH, OUTPUT_HEIGHT = dict.size
133
+
134
  garm_img= garm_img.convert("RGB").resize((768,1024))
135
 
136
  human_img_orig = dict.convert("RGB").resize((768,1024))
 
240
  if is_checked_crop:
241
  out_img = images[0].resize(crop_size)
242
  human_img_orig.paste(out_img, (int(left), int(top)))
243
+ return human_img_orig.resize(OUTPUT_WIDTH, OUTPUT_HEIGHT)
244
  else:
245
+ return images[0].resize(OUTPUT_WIDTH, OUTPUT_HEIGHT)
246
  # return images[0], mask_gray
247
 
248
  garm_list = os.listdir(os.path.join(example_path,"cloth"))