Spaces:
Running
on
Zero
Running
on
Zero
parokshsaxena
commited on
Commit
β’
6e68a36
1
Parent(s):
19ca9bb
fix
Browse files
app.py
CHANGED
@@ -156,7 +156,7 @@ def start_tryon(dict,garm_img,garment_des,is_checked,is_checked_crop,denoise_ste
|
|
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:
|
161 |
mask = pil_to_binary_mask(dict['layers'][0].convert("RGB").resize((WIDTH, HEIGHT)))
|
162 |
# mask = transforms.ToTensor()(mask)
|
@@ -165,7 +165,7 @@ def start_tryon(dict,garm_img,garment_des,is_checked,is_checked_crop,denoise_ste
|
|
165 |
mask_gray = to_pil_image((mask_gray+1.0)/2.0)
|
166 |
|
167 |
|
168 |
-
human_img_arg = _apply_exif_orientation(human_img.resize((
|
169 |
human_img_arg = convert_PIL_to_numpy(human_img_arg, format="BGR")
|
170 |
|
171 |
|
|
|
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:
|
161 |
mask = pil_to_binary_mask(dict['layers'][0].convert("RGB").resize((WIDTH, HEIGHT)))
|
162 |
# mask = transforms.ToTensor()(mask)
|
|
|
165 |
mask_gray = to_pil_image((mask_gray+1.0)/2.0)
|
166 |
|
167 |
|
168 |
+
human_img_arg = _apply_exif_orientation(human_img.resize((POSE_WIDTH,POSE_HEIGHT)))
|
169 |
human_img_arg = convert_PIL_to_numpy(human_img_arg, format="BGR")
|
170 |
|
171 |
|