DawnC commited on
Commit
216e6f8
ยท
1 Parent(s): d073dea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -489,7 +489,6 @@ async def predict(image):
489
  # ๆฏๅ€‹ๅ“็จฎๅ็จฑๅพŒ้ข็ซ‹ๅณ็”ŸๆˆๆŒ‰้ˆ•
490
  button_id = f"Dog {i+1}: More about {breed}"
491
  dogs_info += f"<li><strong>{breed}</strong> ({prob:.2f}% confidence)"
492
- # ๆ–ฐๅขžๆŒ‰้ˆ•๏ผŒ่งธ็™ผ็›ธๆ‡‰ไบ‹ไปถ
493
  dogs_info += f'<button style="background-color: #4CAF50; color: white; border: none; padding: 5px 10px; border-radius: 3px; margin-left: 10px;" onclick="handle_button_click(\'{button_id}\')">Learn More</button></li>'
494
  buttons.append(button_id)
495
  dogs_info += "</ul>"
@@ -498,8 +497,9 @@ async def predict(image):
498
  dogs_info += "<p>The image is unclear or the breed is not in the dataset. Please upload a clearer image.</p>"
499
 
500
  dogs_info += '</div>' # ็ตๆŸ็•ถๅ‰็‹—็š„่ณ‡่จŠๅ€ๅกŠ
501
-
502
-
 
503
  html_output = f"""
504
  <style>
505
  .dog-info {{ border: 1px solid #ddd; margin-bottom: 20px; padding: 15px; border-radius: 5px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }}
@@ -509,7 +509,7 @@ async def predict(image):
509
  </style>
510
  {dogs_info}
511
  """
512
-
513
  # ็”Ÿๆˆ่…ณๆœฌไพ†่™•็†ๆŒ‰้ˆ•้ปžๆ“Šไบ‹ไปถ
514
  html_output += """
515
  <script>
@@ -524,6 +524,7 @@ async def predict(image):
524
  </script>
525
  """
526
 
 
527
  if buttons:
528
  initial_state = {
529
  "dogs_info": dogs_info,
 
489
  # ๆฏๅ€‹ๅ“็จฎๅ็จฑๅพŒ้ข็ซ‹ๅณ็”ŸๆˆๆŒ‰้ˆ•
490
  button_id = f"Dog {i+1}: More about {breed}"
491
  dogs_info += f"<li><strong>{breed}</strong> ({prob:.2f}% confidence)"
 
492
  dogs_info += f'<button style="background-color: #4CAF50; color: white; border: none; padding: 5px 10px; border-radius: 3px; margin-left: 10px;" onclick="handle_button_click(\'{button_id}\')">Learn More</button></li>'
493
  buttons.append(button_id)
494
  dogs_info += "</ul>"
 
497
  dogs_info += "<p>The image is unclear or the breed is not in the dataset. Please upload a clearer image.</p>"
498
 
499
  dogs_info += '</div>' # ็ตๆŸ็•ถๅ‰็‹—็š„่ณ‡่จŠๅ€ๅกŠ
500
+
501
+ buttons_html = ""
502
+
503
  html_output = f"""
504
  <style>
505
  .dog-info {{ border: 1px solid #ddd; margin-bottom: 20px; padding: 15px; border-radius: 5px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }}
 
509
  </style>
510
  {dogs_info}
511
  """
512
+
513
  # ็”Ÿๆˆ่…ณๆœฌไพ†่™•็†ๆŒ‰้ˆ•้ปžๆ“Šไบ‹ไปถ
514
  html_output += """
515
  <script>
 
524
  </script>
525
  """
526
 
527
+
528
  if buttons:
529
  initial_state = {
530
  "dogs_info": dogs_info,