Spaces:
Running
Running
Update app.py
Browse files
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 / "
|
| 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(
|
| 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("
|
|
|
|
| 833 |
with col2:
|
| 834 |
-
st.metric("
|
|
|
|
| 835 |
with col3:
|
| 836 |
-
st.metric("YOLO FPS", f"{
|
| 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")
|