Spaces:
Runtime error
Runtime error
Nik Ska
commited on
Commit
•
90ae13c
1
Parent(s):
3f31a6c
updated app to work wo stories
Browse files
app.py
CHANGED
@@ -34,10 +34,10 @@ def get_mask(img_in):
|
|
34 |
|
35 |
img_square = Image.open(io.BytesIO(base64.b64decode(
|
36 |
result['square'])))
|
37 |
-
img_stories = Image.open(io.BytesIO(base64.b64decode(
|
38 |
-
|
39 |
|
40 |
-
return (img_square,
|
41 |
else:
|
42 |
print(f"ERROR: {response.json()['detail']}")
|
43 |
raise gr.Error(response.json()['detail'])
|
@@ -69,13 +69,12 @@ with gr.Blocks(title="ARKA + TikTok Demo") as app:
|
|
69 |
with gr.Column():
|
70 |
with gr.Row():
|
71 |
output_img = gr.Image(type="pil", label="result_square")
|
72 |
-
output_img1 = gr.Image(type="pil", label="result_stories")
|
73 |
emotion = gr.Label(label="emotion")
|
74 |
|
75 |
-
run_btn.click(get_mask, [input_img], [output_img,
|
76 |
|
77 |
with gr.Row():
|
78 |
gr.HTML(footer)
|
79 |
|
80 |
-
app.launch(share=
|
81 |
auth=((os.environ.get("USERNAME"), os.environ.get("PASSWORD"))))
|
|
|
34 |
|
35 |
img_square = Image.open(io.BytesIO(base64.b64decode(
|
36 |
result['square'])))
|
37 |
+
# img_stories = Image.open(io.BytesIO(base64.b64decode(
|
38 |
+
# result['stories'])))
|
39 |
|
40 |
+
return (img_square, result['emotion'])
|
41 |
else:
|
42 |
print(f"ERROR: {response.json()['detail']}")
|
43 |
raise gr.Error(response.json()['detail'])
|
|
|
69 |
with gr.Column():
|
70 |
with gr.Row():
|
71 |
output_img = gr.Image(type="pil", label="result_square")
|
|
|
72 |
emotion = gr.Label(label="emotion")
|
73 |
|
74 |
+
run_btn.click(get_mask, [input_img], [output_img, emotion])
|
75 |
|
76 |
with gr.Row():
|
77 |
gr.HTML(footer)
|
78 |
|
79 |
+
app.launch(share=True, debug=True, enable_queue=True, show_error=True,
|
80 |
auth=((os.environ.get("USERNAME"), os.environ.get("PASSWORD"))))
|