parokshsaxena commited on
Commit
3a4de36
β€’
1 Parent(s): 0246478

changing arm width to dc, short sleeve

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -131,7 +131,7 @@ WIDTH = int(768)
131
  HEIGHT = int(1024)
132
  POSE_WIDTH = int(WIDTH/2) # int(WIDTH/2)
133
  POSE_HEIGHT = int(HEIGHT/2) #int(HEIGHT/2)
134
-
135
  CATEGORY = "upper_body" # "lower_body"
136
 
137
  def is_cropping_required(width, height):
@@ -196,7 +196,7 @@ def start_tryon(human_img_dict,garm_img,garment_des, background_img, is_checked,
196
  keypoints = openpose_model(human_img.resize((POSE_WIDTH, POSE_HEIGHT)))
197
  model_parse, _ = parsing_model(human_img.resize((POSE_WIDTH, POSE_HEIGHT)))
198
  # internally get mask location function is resizing model_parse to 384x512 if width & height not passed
199
- mask, mask_gray = get_mask_location('hd', CATEGORY, model_parse, keypoints)
200
  mask = mask.resize((WIDTH, HEIGHT))
201
  logging.info("Mask location on model identified")
202
  else:
 
131
  HEIGHT = int(1024)
132
  POSE_WIDTH = int(WIDTH/2) # int(WIDTH/2)
133
  POSE_HEIGHT = int(HEIGHT/2) #int(HEIGHT/2)
134
+ ARM_WIDTH = "dc" # "hd" # hd -> full sleeve, dc for half sleeve
135
  CATEGORY = "upper_body" # "lower_body"
136
 
137
  def is_cropping_required(width, height):
 
196
  keypoints = openpose_model(human_img.resize((POSE_WIDTH, POSE_HEIGHT)))
197
  model_parse, _ = parsing_model(human_img.resize((POSE_WIDTH, POSE_HEIGHT)))
198
  # internally get mask location function is resizing model_parse to 384x512 if width & height not passed
199
+ mask, mask_gray = get_mask_location(ARM_WIDTH, CATEGORY, model_parse, keypoints)
200
  mask = mask.resize((WIDTH, HEIGHT))
201
  logging.info("Mask location on model identified")
202
  else: