Spaces:
Sleeping
Sleeping
lixiang46
commited on
Commit
•
470fd84
1
Parent(s):
18f423a
add test button
Browse files
app.py
CHANGED
@@ -32,12 +32,12 @@ def tryon(person_img, garment_img, seed, randomize_seed):
|
|
32 |
"seed": seed
|
33 |
}
|
34 |
response = requests.post(url, headers=headers, data=json.dumps(data), timeout=40)
|
35 |
-
print("post code", response.status_code)
|
36 |
if response.status_code == 200:
|
37 |
result = response.json()['result']
|
38 |
status = result['status']
|
39 |
if status == "success":
|
40 |
-
uuid = result['
|
41 |
print(uuid)
|
42 |
|
43 |
try:
|
@@ -45,7 +45,7 @@ def tryon(person_img, garment_img, seed, randomize_seed):
|
|
45 |
session = requests.Session()
|
46 |
session.mount("http://", HTTPAdapter(max_retries=3))
|
47 |
response = session.get(url, headers=headers, timeout=10)
|
48 |
-
print("response code", response.status_code)
|
49 |
if response.status_code == 200:
|
50 |
result = response.json()['result']
|
51 |
status = result['status']
|
@@ -224,7 +224,7 @@ with gr.Blocks(css=css) as Tryon:
|
|
224 |
seed_used = gr.Number(label="Seed used")
|
225 |
result_info = gr.Text(label="Response")
|
226 |
try_button = gr.Button(value="Run", elem_id="button")
|
227 |
-
test_button = gr.Button(value="
|
228 |
|
229 |
|
230 |
try_button.click(fn=start_tryon, inputs=[imgs, garm_img, seed, randomize_seed], outputs=[image_out, seed_used, result_info], api_name='tryon',concurrency_limit=10)
|
|
|
32 |
"seed": seed
|
33 |
}
|
34 |
response = requests.post(url, headers=headers, data=json.dumps(data), timeout=40)
|
35 |
+
print("post response code", response.status_code)
|
36 |
if response.status_code == 200:
|
37 |
result = response.json()['result']
|
38 |
status = result['status']
|
39 |
if status == "success":
|
40 |
+
uuid = result['result']
|
41 |
print(uuid)
|
42 |
|
43 |
try:
|
|
|
45 |
session = requests.Session()
|
46 |
session.mount("http://", HTTPAdapter(max_retries=3))
|
47 |
response = session.get(url, headers=headers, timeout=10)
|
48 |
+
print("get response code", response.status_code)
|
49 |
if response.status_code == 200:
|
50 |
result = response.json()['result']
|
51 |
status = result['status']
|
|
|
224 |
seed_used = gr.Number(label="Seed used")
|
225 |
result_info = gr.Text(label="Response")
|
226 |
try_button = gr.Button(value="Run", elem_id="button")
|
227 |
+
test_button = gr.Button(value="Test", elem_id="button")
|
228 |
|
229 |
|
230 |
try_button.click(fn=start_tryon, inputs=[imgs, garm_img, seed, randomize_seed], outputs=[image_out, seed_used, result_info], api_name='tryon',concurrency_limit=10)
|