Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -413,12 +413,12 @@ with gr.Blocks(css="""
|
|
413 |
|
414 |
async def safe_predict(image):
|
415 |
try:
|
416 |
-
# ๅพ predict
|
417 |
-
prediction, annotated_img, buttons_options
|
418 |
if buttons_options: # ๅฆๆๆๅค็็ตๆ๏ผ้กฏ็คบ้ธ้
ๆ้
|
419 |
-
return prediction, annotated_img, gr.update(visible=True, choices=buttons_options),
|
420 |
else: # ๅฎ็้ ๆธฌๆ้ฑ่ๆ้
|
421 |
-
return prediction, annotated_img, gr.update(visible=False),
|
422 |
except Exception as e:
|
423 |
return str(e), None, gr.update(visible=False), gr.update(visible=False), gr.update(visible=False)
|
424 |
|
|
|
413 |
|
414 |
async def safe_predict(image):
|
415 |
try:
|
416 |
+
# ๅพ predict ๅฝๆธ่ฟๅ็ๅผๆธๆ่ฉฒ่ๆญค่ๅน้
|
417 |
+
prediction, annotated_img, buttons_options = await predict(image)
|
418 |
if buttons_options: # ๅฆๆๆๅค็็ตๆ๏ผ้กฏ็คบ้ธ้
ๆ้
|
419 |
+
return prediction, annotated_img, gr.update(visible=True, choices=buttons_options), gr.update(visible=True)
|
420 |
else: # ๅฎ็้ ๆธฌๆ้ฑ่ๆ้
|
421 |
+
return prediction, annotated_img, gr.update(visible=False), gr.update(visible=False)
|
422 |
except Exception as e:
|
423 |
return str(e), None, gr.update(visible=False), gr.update(visible=False), gr.update(visible=False)
|
424 |
|