Update src/streamlit_app.py
Browse files- src/streamlit_app.py +7 -7
src/streamlit_app.py
CHANGED
|
@@ -512,7 +512,7 @@ if page == "Home":
|
|
| 512 |
st.info("Dataset not ready or no image selected yet.")
|
| 513 |
else:
|
| 514 |
st.sidebar.image(
|
| 515 |
-
|
| 516 |
caption="Selected Image",
|
| 517 |
use_container_width=True,
|
| 518 |
)
|
|
@@ -520,12 +520,12 @@ if page == "Home":
|
|
| 520 |
col1, col2 = st.columns([1, 1])
|
| 521 |
with col1:
|
| 522 |
st.subheader("Chosen Image")
|
| 523 |
-
st.image(
|
| 524 |
|
| 525 |
with col2:
|
| 526 |
st.subheader("Prediction Output")
|
| 527 |
if st.button("Predict"):
|
| 528 |
-
result = predict_image(
|
| 529 |
if result.get("error"):
|
| 530 |
st.error(result["error"])
|
| 531 |
else:
|
|
@@ -551,11 +551,11 @@ elif page == "Training Report":
|
|
| 551 |
if CONFUSION_IMAGE_PATH.exists():
|
| 552 |
left, center, right = st.columns([1, 3, 1])
|
| 553 |
with center:
|
| 554 |
-
st.image(
|
| 555 |
else:
|
| 556 |
-
st.
|
| 557 |
-
|
| 558 |
-
"
|
| 559 |
)
|
| 560 |
|
| 561 |
# -------------------------------------------------------------------
|
|
|
|
| 512 |
st.info("Dataset not ready or no image selected yet.")
|
| 513 |
else:
|
| 514 |
st.sidebar.image(
|
| 515 |
+
selected_image_path.as_posix(),
|
| 516 |
caption="Selected Image",
|
| 517 |
use_container_width=True,
|
| 518 |
)
|
|
|
|
| 520 |
col1, col2 = st.columns([1, 1])
|
| 521 |
with col1:
|
| 522 |
st.subheader("Chosen Image")
|
| 523 |
+
st.image(selected_image_path.as_posix(), use_container_width=True)
|
| 524 |
|
| 525 |
with col2:
|
| 526 |
st.subheader("Prediction Output")
|
| 527 |
if st.button("Predict"):
|
| 528 |
+
result = predict_image(selected_image_path.as_posix())
|
| 529 |
if result.get("error"):
|
| 530 |
st.error(result["error"])
|
| 531 |
else:
|
|
|
|
| 551 |
if CONFUSION_IMAGE_PATH.exists():
|
| 552 |
left, center, right = st.columns([1, 3, 1])
|
| 553 |
with center:
|
| 554 |
+
st.image(CONFUSION_IMAGE_PATH.as_posix(), use_container_width=True)
|
| 555 |
else:
|
| 556 |
+
st.warning(
|
| 557 |
+
"Confusion matrix image not found. "
|
| 558 |
+
"Place `confusion_matrix_normalized.png` under `src/reports/`."
|
| 559 |
)
|
| 560 |
|
| 561 |
# -------------------------------------------------------------------
|