Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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,
|