Spaces:
Paused
Paused
lixiang46
commited on
Commit
·
cc17840
1
Parent(s):
6803e6c
add step message
Browse files
app.py
CHANGED
|
@@ -33,7 +33,6 @@ def start_tryon(person_img, garment_img, seed, randomize_seed):
|
|
| 33 |
|
| 34 |
response = requests.post(url, headers=headers, data=json.dumps(data))
|
| 35 |
print("response code", response.status_code)
|
| 36 |
-
print(response.text)
|
| 37 |
result_img = None
|
| 38 |
if response.status_code == 200:
|
| 39 |
result = response.json()['result']
|
|
@@ -47,6 +46,7 @@ def start_tryon(person_img, garment_img, seed, randomize_seed):
|
|
| 47 |
else:
|
| 48 |
info = "Try again latter"
|
| 49 |
else:
|
|
|
|
| 50 |
info = "URL error, pleace contact the admin"
|
| 51 |
|
| 52 |
return result_img, seed, info
|
|
@@ -95,6 +95,7 @@ with gr.Blocks(css=css) as Tryon:
|
|
| 95 |
gr.HTML(load_description("assets/title.md"))
|
| 96 |
with gr.Row():
|
| 97 |
with gr.Column(elem_id = "col-left"):
|
|
|
|
| 98 |
imgs = gr.Image(label="Person image", sources='upload', type="numpy")
|
| 99 |
# category = gr.Dropdown(label="Garment category", choices=['upper_body', 'lower_body', 'dresses'], value="upper_body")
|
| 100 |
example = gr.Examples(
|
|
@@ -103,12 +104,15 @@ with gr.Blocks(css=css) as Tryon:
|
|
| 103 |
examples=human_list_path
|
| 104 |
)
|
| 105 |
with gr.Column(elem_id = "col-mid"):
|
|
|
|
| 106 |
garm_img = gr.Image(label="Garment image", sources='upload', type="numpy")
|
| 107 |
example = gr.Examples(
|
| 108 |
inputs=garm_img,
|
| 109 |
examples_per_page=12,
|
| 110 |
-
examples=garm_list_path
|
|
|
|
| 111 |
with gr.Column(elem_id = "col-right"):
|
|
|
|
| 112 |
image_out = gr.Image(label="Result", show_share_button=False)
|
| 113 |
with gr.Row():
|
| 114 |
seed = gr.Slider(
|
|
|
|
| 33 |
|
| 34 |
response = requests.post(url, headers=headers, data=json.dumps(data))
|
| 35 |
print("response code", response.status_code)
|
|
|
|
| 36 |
result_img = None
|
| 37 |
if response.status_code == 200:
|
| 38 |
result = response.json()['result']
|
|
|
|
| 46 |
else:
|
| 47 |
info = "Try again latter"
|
| 48 |
else:
|
| 49 |
+
print(response.text)
|
| 50 |
info = "URL error, pleace contact the admin"
|
| 51 |
|
| 52 |
return result_img, seed, info
|
|
|
|
| 95 |
gr.HTML(load_description("assets/title.md"))
|
| 96 |
with gr.Row():
|
| 97 |
with gr.Column(elem_id = "col-left"):
|
| 98 |
+
gr.Markdown("###Step 1. Upload a person image. ⬇️")
|
| 99 |
imgs = gr.Image(label="Person image", sources='upload', type="numpy")
|
| 100 |
# category = gr.Dropdown(label="Garment category", choices=['upper_body', 'lower_body', 'dresses'], value="upper_body")
|
| 101 |
example = gr.Examples(
|
|
|
|
| 104 |
examples=human_list_path
|
| 105 |
)
|
| 106 |
with gr.Column(elem_id = "col-mid"):
|
| 107 |
+
gr.Markdown("###Step 2. Upload a garment image. ⬇️")
|
| 108 |
garm_img = gr.Image(label="Garment image", sources='upload', type="numpy")
|
| 109 |
example = gr.Examples(
|
| 110 |
inputs=garm_img,
|
| 111 |
examples_per_page=12,
|
| 112 |
+
examples=garm_list_path
|
| 113 |
+
)
|
| 114 |
with gr.Column(elem_id = "col-right"):
|
| 115 |
+
gr.Markdown("###Step 3. Press the “Run” button to get try-on results.")
|
| 116 |
image_out = gr.Image(label="Result", show_share_button=False)
|
| 117 |
with gr.Row():
|
| 118 |
seed = gr.Slider(
|