parokshsaxena commited on
Commit
f639b5d
β€’
1 Parent(s): 45cc2fd

keeping pose height and width variable and making it int, upgrading gradio version

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +4 -2
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: πŸ‘•πŸ‘”πŸ‘š
4
  colorFrom: yellow
5
  colorTo: red
6
  sdk: gradio
7
- sdk_version: 4.24.0
8
  app_file: app.py
9
  pinned: false
10
  license: cc-by-nc-sa-4.0
 
4
  colorFrom: yellow
5
  colorTo: red
6
  sdk: gradio
7
+ sdk_version: 4.26.0
8
  app_file: app.py
9
  pinned: false
10
  license: cc-by-nc-sa-4.0
app.py CHANGED
@@ -123,6 +123,8 @@ pipe.unet_encoder = UNet_Encoder
123
 
124
  WIDTH = 4160 # 768
125
  HEIGHT = 6240 # 1024
 
 
126
 
127
  @spaces.GPU
128
  def start_tryon(dict,garm_img,garment_des,is_checked,is_checked_crop,denoise_steps,seed):
@@ -151,8 +153,8 @@ def start_tryon(dict,garm_img,garment_des,is_checked,is_checked_crop,denoise_ste
151
 
152
 
153
  if is_checked:
154
- keypoints = openpose_model(human_img.resize((WIDTH/2,HEIGHT/2)))
155
- model_parse, _ = parsing_model(human_img.resize((WIDTH/2,HEIGHT/2)))
156
  mask, mask_gray = get_mask_location('hd', "upper_body", model_parse, keypoints)
157
  mask = mask.resize((WIDTH,HEIGHT))
158
  else:
 
123
 
124
  WIDTH = 4160 # 768
125
  HEIGHT = 6240 # 1024
126
+ POSE_WIDTH = int(WIDTH/2)
127
+ POSE_HEIGHT = int(HEIGHT/2)
128
 
129
  @spaces.GPU
130
  def start_tryon(dict,garm_img,garment_des,is_checked,is_checked_crop,denoise_steps,seed):
 
153
 
154
 
155
  if is_checked:
156
+ keypoints = openpose_model(human_img.resize((POSE_WIDTH, POSE_HEIGHT)))
157
+ model_parse, _ = parsing_model(human_img.resize((POSE_WIDTH, POSE_HEIGHT)))
158
  mask, mask_gray = get_mask_location('hd', "upper_body", model_parse, keypoints)
159
  mask = mask.resize((WIDTH,HEIGHT))
160
  else: