AI-Solutions-KK commited on
Commit
f6b379e
·
verified ·
1 Parent(s): a612436

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. 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
- str(selected_image_path),
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(str(selected_image_path), use_container_width=True)
524
 
525
  with col2:
526
  st.subheader("Prediction Output")
527
  if st.button("Predict"):
528
- result = predict_image(str(selected_image_path))
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(str(CONFUSION_IMAGE_PATH), width=700)
555
  else:
556
- st.info(
557
- f"Confusion matrix image not found at `{CONFUSION_IMAGE_PATH}`. "
558
- "Save your PNG there to display it here."
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
  # -------------------------------------------------------------------