Spaces:
Build error
Build error
Update run/gradio_ootd.py
Browse files- run/gradio_ootd.py +6 -5
run/gradio_ootd.py
CHANGED
@@ -62,16 +62,17 @@ def decode_image_from_base64(image_data):
|
|
62 |
def process_hd(vton_img, garm_img,category, n_samples, n_steps, image_scale, seed):
|
63 |
model_type = 'dc'
|
64 |
with torch.no_grad():
|
65 |
-
openpose_model_dc.preprocessor.body_estimation.model.
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
garm_img = decode_image_from_base64(garm_img).resize((768, 1024))
|
71 |
vton_img = decode_image_from_base64(vton_img).resize((768, 1024))
|
72 |
keypoints = openpose_model_dc(vton_img.resize((384, 512)))
|
73 |
model_parse, _ = parsing_model_dc(vton_img.resize((384, 512)))
|
74 |
|
|
|
75 |
mask, mask_gray = get_mask_location(model_type, category_dict_utils[category], model_parse, keypoints)
|
76 |
mask = mask.resize((768, 1024), Image.NEAREST)
|
77 |
mask_gray = mask_gray.resize((768, 1024), Image.NEAREST)
|
|
|
62 |
def process_hd(vton_img, garm_img,category, n_samples, n_steps, image_scale, seed):
|
63 |
model_type = 'dc'
|
64 |
with torch.no_grad():
|
65 |
+
openpose_model_dc.preprocessor.body_estimation.model.to('cuda')
|
66 |
+
ootd_model_dc.pipe.to('cuda')
|
67 |
+
ootd_model_dc.image_encoder.to('cuda')
|
68 |
+
ootd_model_dc.text_encoder.to('cuda')
|
69 |
+
|
70 |
garm_img = decode_image_from_base64(garm_img).resize((768, 1024))
|
71 |
vton_img = decode_image_from_base64(vton_img).resize((768, 1024))
|
72 |
keypoints = openpose_model_dc(vton_img.resize((384, 512)))
|
73 |
model_parse, _ = parsing_model_dc(vton_img.resize((384, 512)))
|
74 |
|
75 |
+
|
76 |
mask, mask_gray = get_mask_location(model_type, category_dict_utils[category], model_parse, keypoints)
|
77 |
mask = mask.resize((768, 1024), Image.NEAREST)
|
78 |
mask_gray = mask_gray.resize((768, 1024), Image.NEAREST)
|