yogesh-venkat commited on
Commit
4051bd1
Β·
verified Β·
1 Parent(s): 3c703d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -76,7 +76,7 @@ SMARTVISION_METRICS_DIR = REPO_ROOT / "smartvision_metrics"
76
  SMARTVISION_DATASET_DIR = REPO_ROOT / "smartvision_dataset"
77
 
78
  # Then turn constants into Path objects / strings
79
- YOLO_WEIGHTS_PATH = str(YOLO_RUNS_DIR / "smartvision_yolov8s6 - Copy" / "weights" / "best.pt")
80
 
81
  CLASSIFIER_MODEL_CONFIGS = {
82
  "VGG16": {
@@ -104,7 +104,7 @@ CLASS_METRIC_PATHS = {
104
  "EfficientNetB0": str(SMARTVISION_METRICS_DIR / "efficientnetb0" / "metrics.json"),
105
  }
106
 
107
- YOLO_METRICS_JSON = str(REPO_ROOT / "yolo_metrics" / "yolov8s_metrics.json")
108
  BASE_DIR = str(SMARTVISION_DATASET_DIR)
109
  CLASS_DIR = str(SMARTVISION_DATASET_DIR / "classification")
110
  DET_DIR = str(SMARTVISION_DATASET_DIR / "detection")
@@ -827,15 +827,19 @@ elif page == "πŸ“Š Model Performance":
827
  if not yolo_m:
828
  st.info("No YOLO metrics found yet in `yolo_metrics/`.")
829
  else:
 
 
 
 
830
  col1, col2, col3 = st.columns(3)
831
  with col1:
832
- st.metric("mAP@0.5", f"{yolo_m.get('map_50', 0):.3f}")
 
833
  with col2:
834
- st.metric("mAP@0.5:0.95", f"{yolo_m.get('map_50_95', 0):.3f}")
 
835
  with col3:
836
- st.metric("YOLO FPS", f"{yolo_m.get('fps', 0):.2f}")
837
-
838
- st.write("YOLO metrics JSON:", YOLO_METRICS_JSON)
839
 
840
  # --- Confusion matrix & comparison plots (if available) ---
841
  st.markdown("### πŸ“ˆ Comparison Plots & Confusion Matrices")
 
76
  SMARTVISION_DATASET_DIR = REPO_ROOT / "smartvision_dataset"
77
 
78
  # Then turn constants into Path objects / strings
79
+ YOLO_WEIGHTS_PATH = str(YOLO_RUNS_DIR / "smartvision_yolov8s_alltrain3" / "weights" / "best.pt")
80
 
81
  CLASSIFIER_MODEL_CONFIGS = {
82
  "VGG16": {
 
104
  "EfficientNetB0": str(SMARTVISION_METRICS_DIR / "efficientnetb0" / "metrics.json"),
105
  }
106
 
107
+ YOLO_METRICS_JSON = str(YOLO_RUNS_DIR / "smartvision_yolov8s_alltrain3" /"validation_all_20251206_210906" /"validation_metrics_all.json")
108
  BASE_DIR = str(SMARTVISION_DATASET_DIR)
109
  CLASS_DIR = str(SMARTVISION_DATASET_DIR / "classification")
110
  DET_DIR = str(SMARTVISION_DATASET_DIR / "detection")
 
827
  if not yolo_m:
828
  st.info("No YOLO metrics found yet in `yolo_metrics/`.")
829
  else:
830
+ # Extract nested metrics
831
+ overall = yolo_m.get('overall_metrics', {})
832
+ speed = yolo_m.get('speed_metrics', {})
833
+
834
  col1, col2, col3 = st.columns(3)
835
  with col1:
836
+ st.metric("Precision", f"{overall.get("precision", 0):.3f}")
837
+ st.metric("mAP@0.5", f"{overall.get('mAP50', 0):.3f}")
838
  with col2:
839
+ st.metric("Recall", f"{overall.get("recall", 0):.3f}")
840
+ st.metric("mAP@0.5:0.95", f"{overall.get('mAP50_95', 0):.3f}")
841
  with col3:
842
+ st.metric("YOLO FPS", f"{speed.get('fps', 0):.2f}")
 
 
843
 
844
  # --- Confusion matrix & comparison plots (if available) ---
845
  st.markdown("### πŸ“ˆ Comparison Plots & Confusion Matrices")