Spaces:
Runtime error
Runtime error
lixiang46
commited on
Commit
•
8654223
1
Parent(s):
5cbc9b1
test
Browse files
app.py
CHANGED
@@ -15,6 +15,10 @@ def start_tryon(person_img, garment_img, seed, randomize_seed):
|
|
15 |
encoded_person_img = base64.b64encode(encoded_person_img).decode('utf-8')
|
16 |
encoded_garment_img = cv2.imencode('.jpg', garment_img)[1].tobytes()
|
17 |
encoded_garment_img = base64.b64encode(encoded_garment_img).decode('utf-8')
|
|
|
|
|
|
|
|
|
18 |
|
19 |
return person_img, seed
|
20 |
|
@@ -84,5 +88,5 @@ with gr.Blocks(css=css) as Tryon:
|
|
84 |
try_button.click(fn=start_tryon, inputs=[imgs, garm_img, seed, randomize_seed], outputs=[image_out, seed_used], api_name='tryon')
|
85 |
|
86 |
ip = requests.get('http://ifconfig.me/ip', timeout=1).text.strip()
|
87 |
-
print("ip address
|
88 |
Tryon.queue(max_size=10).launch()
|
|
|
15 |
encoded_person_img = base64.b64encode(encoded_person_img).decode('utf-8')
|
16 |
encoded_garment_img = cv2.imencode('.jpg', garment_img)[1].tobytes()
|
17 |
encoded_garment_img = base64.b64encode(encoded_garment_img).decode('utf-8')
|
18 |
+
|
19 |
+
url = "http://" + os.environ['tryon_url']
|
20 |
+
token = os.environ['token']
|
21 |
+
print(url, token)
|
22 |
|
23 |
return person_img, seed
|
24 |
|
|
|
88 |
try_button.click(fn=start_tryon, inputs=[imgs, garm_img, seed, randomize_seed], outputs=[image_out, seed_used], api_name='tryon')
|
89 |
|
90 |
ip = requests.get('http://ifconfig.me/ip', timeout=1).text.strip()
|
91 |
+
print("ip address", ip)
|
92 |
Tryon.queue(max_size=10).launch()
|