DawnC commited on
Commit
2f6a4a2
ยท
1 Parent(s): de20416

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -413,12 +413,12 @@ with gr.Blocks(css="""
413
 
414
  async def safe_predict(image):
415
  try:
416
- # ๅพž predict ๅ‡ฝๆ•ธ่ฟ”ๅ›ž 4 ๅ€‹็ตๆžœ
417
- prediction, annotated_img, buttons_options, breed_detail = await predict(image)
418
  if buttons_options: # ๅฆ‚ๆžœๆœ‰ๅคš็‹—็ตๆžœ๏ผŒ้กฏ็คบ้ธ้ …ๆŒ‰้ˆ•
419
- return prediction, annotated_img, gr.update(visible=True, choices=buttons_options), breed_detail
420
  else: # ๅ–ฎ็‹—้ ๆธฌๆ™‚้šฑ่—ๆŒ‰้ˆ•
421
- return prediction, annotated_img, gr.update(visible=False), breed_detail
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