Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -578,7 +578,7 @@ async def predict(image):
|
|
578 |
"image": annotated_image,
|
579 |
"is_multi_dog": len(dogs) > 1,
|
580 |
"dogs_info": html_output,
|
581 |
-
"original_html": html_output # 新增這行
|
582 |
}
|
583 |
return html_output, annotated_image, gr.update(visible=True, choices=buttons), initial_state
|
584 |
else:
|
@@ -616,7 +616,7 @@ def show_details_html(choice, previous_output, initial_state):
|
|
616 |
"""
|
617 |
|
618 |
initial_state["current_description"] = html_output
|
619 |
-
initial_state["original_buttons"] = initial_state.get("buttons", [])
|
620 |
|
621 |
return html_output, gr.update(visible=True), initial_state
|
622 |
except Exception as e:
|
@@ -643,8 +643,8 @@ def format_description_html(description, breed):
|
|
643 |
def go_back(state):
|
644 |
buttons = state.get("buttons", [])
|
645 |
return (
|
646 |
-
|
647 |
-
state["original_html"],
|
648 |
state["image"],
|
649 |
gr.update(visible=True, choices=buttons),
|
650 |
gr.update(visible=False),
|
|
|
578 |
"image": annotated_image,
|
579 |
"is_multi_dog": len(dogs) > 1,
|
580 |
"dogs_info": html_output,
|
581 |
+
#"original_html": html_output # 新增這行
|
582 |
}
|
583 |
return html_output, annotated_image, gr.update(visible=True, choices=buttons), initial_state
|
584 |
else:
|
|
|
616 |
"""
|
617 |
|
618 |
initial_state["current_description"] = html_output
|
619 |
+
#initial_state["original_buttons"] = initial_state.get("buttons", [])
|
620 |
|
621 |
return html_output, gr.update(visible=True), initial_state
|
622 |
except Exception as e:
|
|
|
643 |
def go_back(state):
|
644 |
buttons = state.get("buttons", [])
|
645 |
return (
|
646 |
+
state["dogs_info"], # 這裡應該是完整的 HTML 內容
|
647 |
+
#state["original_html"],
|
648 |
state["image"],
|
649 |
gr.update(visible=True, choices=buttons),
|
650 |
gr.update(visible=False),
|