Spaces:
Sleeping
Sleeping
Update streamlit_app.py
Browse files- streamlit_app.py +10 -11
streamlit_app.py
CHANGED
|
@@ -310,8 +310,9 @@ def main() -> None:
|
|
| 310 |
key="compress_mb",
|
| 311 |
)
|
| 312 |
|
| 313 |
-
|
| 314 |
-
|
|
|
|
| 315 |
if not st.session_state.get("video_path"):
|
| 316 |
st.sidebar.error("No video loaded – load a video first.")
|
| 317 |
else:
|
|
@@ -333,14 +334,7 @@ def main() -> None:
|
|
| 333 |
st.session_state["last_error_detail"] = traceback.format_exc()
|
| 334 |
finally:
|
| 335 |
st.session_state["busy"] = False
|
| 336 |
-
|
| 337 |
-
# ---------- Main panel ----------
|
| 338 |
-
if st.session_state["last_error"]:
|
| 339 |
-
st.error(st.session_state["last_error"])
|
| 340 |
-
|
| 341 |
-
if st.session_state.get("video_path"):
|
| 342 |
-
st.video(st.session_state["video_path"])
|
| 343 |
-
|
| 344 |
if st.session_state.get("analysis_out"):
|
| 345 |
st.subheader("📝 Analysis")
|
| 346 |
st.write(st.session_state["analysis_out"])
|
|
@@ -348,11 +342,16 @@ def main() -> None:
|
|
| 348 |
with st.expander("Show raw model output"):
|
| 349 |
st.code(st.session_state["raw_output"], language="text")
|
| 350 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 351 |
if st.session_state.get("last_error_detail"):
|
| 352 |
with st.expander("Show error details"):
|
| 353 |
st.code(st.session_state["last_error_detail"], language="text")
|
| 354 |
|
| 355 |
-
|
| 356 |
# ----------------------------------------------------------------------
|
| 357 |
# Session‑state defaults
|
| 358 |
# ----------------------------------------------------------------------
|
|
|
|
| 310 |
key="compress_mb",
|
| 311 |
)
|
| 312 |
|
| 313 |
+
# ---------- Main panel ----------
|
| 314 |
+
# Run Analysis button
|
| 315 |
+
if st.button("Run Analysis"):
|
| 316 |
if not st.session_state.get("video_path"):
|
| 317 |
st.sidebar.error("No video loaded – load a video first.")
|
| 318 |
else:
|
|
|
|
| 334 |
st.session_state["last_error_detail"] = traceback.format_exc()
|
| 335 |
finally:
|
| 336 |
st.session_state["busy"] = False
|
| 337 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 338 |
if st.session_state.get("analysis_out"):
|
| 339 |
st.subheader("📝 Analysis")
|
| 340 |
st.write(st.session_state["analysis_out"])
|
|
|
|
| 342 |
with st.expander("Show raw model output"):
|
| 343 |
st.code(st.session_state["raw_output"], language="text")
|
| 344 |
|
| 345 |
+
if st.session_state.get("video_path"):
|
| 346 |
+
st.video(st.session_state["video_path"])
|
| 347 |
+
|
| 348 |
+
if st.session_state["last_error"]:
|
| 349 |
+
st.error(st.session_state["last_error"])
|
| 350 |
+
|
| 351 |
if st.session_state.get("last_error_detail"):
|
| 352 |
with st.expander("Show error details"):
|
| 353 |
st.code(st.session_state["last_error_detail"], language="text")
|
| 354 |
|
|
|
|
| 355 |
# ----------------------------------------------------------------------
|
| 356 |
# Session‑state defaults
|
| 357 |
# ----------------------------------------------------------------------
|