Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
|
@@ -97,7 +97,7 @@ with gr.Blocks() as demo:
|
|
| 97 |
q = image_clean
|
| 98 |
q = q.reshape((64, 320, 3))
|
| 99 |
#print (q.min(), q.max())
|
| 100 |
-
yield i, q,
|
| 101 |
yield i, q, submit_btn.update(visible=True)
|
| 102 |
#with requests.post(url=API_ENDPOINT, data=data, timeout=600, stream=True) as r:
|
| 103 |
# i = 0
|
|
@@ -106,9 +106,9 @@ with gr.Blocks() as demo:
|
|
| 106 |
# r = base64.decodebytes(response.encode('ascii'))
|
| 107 |
# q = np.frombuffer(r, dtype=np.float32).reshape((64, 320, 3))
|
| 108 |
# i += 1
|
| 109 |
-
# yield i, q,
|
| 110 |
-
# yield i, q,
|
| 111 |
except Exception as e:
|
| 112 |
-
yield 1000, 255*np.ones((64, 320, 3)),
|
| 113 |
submit_btn.click(fn=infer, inputs=inputs, outputs=outputs, concurrency_limit=1)
|
| 114 |
demo.queue(max_size=20).launch()
|
|
|
|
| 97 |
q = image_clean
|
| 98 |
q = q.reshape((64, 320, 3))
|
| 99 |
#print (q.min(), q.max())
|
| 100 |
+
yield i, q, gr.update(visible=False)
|
| 101 |
yield i, q, submit_btn.update(visible=True)
|
| 102 |
#with requests.post(url=API_ENDPOINT, data=data, timeout=600, stream=True) as r:
|
| 103 |
# i = 0
|
|
|
|
| 106 |
# r = base64.decodebytes(response.encode('ascii'))
|
| 107 |
# q = np.frombuffer(r, dtype=np.float32).reshape((64, 320, 3))
|
| 108 |
# i += 1
|
| 109 |
+
# yield i, q, gr.update(visible=False)
|
| 110 |
+
# yield i, q, gr.update(visible=True)
|
| 111 |
except Exception as e:
|
| 112 |
+
yield 1000, 255*np.ones((64, 320, 3)), gr.update(visible=True)
|
| 113 |
submit_btn.click(fn=infer, inputs=inputs, outputs=outputs, concurrency_limit=1)
|
| 114 |
demo.queue(max_size=20).launch()
|