Spaces:
Running
on
Zero
Running
on
Zero
parokshsaxena
commited on
Commit
β’
f639b5d
1
Parent(s):
45cc2fd
keeping pose height and width variable and making it int, upgrading gradio version
Browse files
README.md
CHANGED
@@ -4,7 +4,7 @@ emoji: πππ
|
|
4 |
colorFrom: yellow
|
5 |
colorTo: red
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 4.
|
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((
|
155 |
-
model_parse, _ = parsing_model(human_img.resize((
|
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:
|