Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -343,8 +343,8 @@ async def predict(image):
|
|
343 |
buttons_html += f'<button style="display:inline-block; margin-top:10px;" onclick="handle_button_click(\'{button_id}\')">{breed}</button>'
|
344 |
print(f"Button generated for breed: {breed}") # 檢查按鈕是否生成
|
345 |
|
346 |
-
|
347 |
-
dogs_info += f'<div>{buttons_html}</div>' # 確保按鈕顯示在該品種描述下
|
348 |
|
349 |
else: # 條件3:當 conf < 0.15 時,返回 "圖像不清晰或無法辨認"
|
350 |
dogs_info += "<p>The image is unclear or the breed is not in the dataset. Please upload a clearer image.</p>"
|
@@ -358,6 +358,8 @@ async def predict(image):
|
|
358 |
</style>
|
359 |
{dogs_info}
|
360 |
"""
|
|
|
|
|
361 |
|
362 |
|
363 |
|
|
|
343 |
buttons_html += f'<button style="display:inline-block; margin-top:10px;" onclick="handle_button_click(\'{button_id}\')">{breed}</button>'
|
344 |
print(f"Button generated for breed: {breed}") # 檢查按鈕是否生成
|
345 |
|
346 |
+
# 渲染按鈕,確保CSS樣式顯示正確
|
347 |
+
dogs_info += f'<div style="margin-top:10px;">{buttons_html}</div>' # 確保按鈕顯示在該品種描述下
|
348 |
|
349 |
else: # 條件3:當 conf < 0.15 時,返回 "圖像不清晰或無法辨認"
|
350 |
dogs_info += "<p>The image is unclear or the breed is not in the dataset. Please upload a clearer image.</p>"
|
|
|
358 |
</style>
|
359 |
{dogs_info}
|
360 |
"""
|
361 |
+
print(f"Final HTML output: {html_output}") # 檢查最終生成的 HTML
|
362 |
+
|
363 |
|
364 |
|
365 |
|