Update README.md
Browse files
README.md
CHANGED
@@ -21,21 +21,16 @@ This model detects and segments six types of vehicle damage: cracks, dents, glas
|
|
21 |
|
22 |
## Performance Metrics
|
23 |
|
24 |
-
### Overall Performance
|
25 |
-
| Task | Precision | Recall | mAP50 | mAP50-95 |
|
26 |
-
|------|-----------|--------|-------|----------|
|
27 |
-
| Box | 0.753 | 0.689 | 0.734 | 0.513 |
|
28 |
-
| Mask | 0.762 | 0.692 | 0.735 | 0.503 |
|
29 |
|
30 |
### Class-Specific Performance (Mask Segmentation)
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
|
40 |
## Training Recipe
|
41 |
|
@@ -116,6 +111,62 @@ The model was trained on the CarDD (Car Damage Detection) dataset with:
|
|
116 |
|
117 |
## Usage
|
118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
## Limitations
|
120 |
|
121 |
- Lower recall for crack detection (36.8%)
|
|
|
21 |
|
22 |
## Performance Metrics
|
23 |
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
### Class-Specific Performance (Mask Segmentation)
|
26 |
+
Class Images Instances Box(P R mAP50 mAP50-95) Mask(P R mAP50 mAP50-95)
|
27 |
+
all 571 1247 0.824 0.75 0.799 0.599 0.827 0.749 0.792 0.576
|
28 |
+
crack 92 152 0.657 0.48 0.545 0.322 0.665 0.483 0.518 0.214
|
29 |
+
dent 249 366 0.706 0.571 0.633 0.377 0.697 0.56 0.612 0.344
|
30 |
+
glass shatter 89 91 0.98 0.989 0.994 0.728 0.981 0.989 0.994 0.784
|
31 |
+
lamp broken 103 103 0.91 0.893 0.964 0.791 0.921 0.902 0.967 0.808
|
32 |
+
scratch 281 482 0.728 0.614 0.676 0.421 0.734 0.613 0.68 0.368
|
33 |
+
tire flat 50 53 0.962 0.951 0.982 0.951 0.962 0.949 0.982 0.941
|
34 |
|
35 |
## Training Recipe
|
36 |
|
|
|
111 |
|
112 |
## Usage
|
113 |
|
114 |
+
|
115 |
+
Download weight: `!wget https://huggingface.co/harpreetsahota/car-dd-segmentation-yolov11/resolve/main/best.pt -O yolov11-seg-cardd.pt`
|
116 |
+
|
117 |
+
```
|
118 |
+
from ultralytics import YOLO
|
119 |
+
import os
|
120 |
+
import gdown
|
121 |
+
|
122 |
+
# Load the model
|
123 |
+
model = YOLO('best.pt')
|
124 |
+
|
125 |
+
# Apply the model to the test dataset
|
126 |
+
# FiftyOne automatically handles batching and processing
|
127 |
+
test_dataset.apply_model(
|
128 |
+
model,
|
129 |
+
label_field="yolo_predictions", # Field name to store predictions
|
130 |
+
confidence_thresh=0.25, # Minimum confidence threshold
|
131 |
+
batch_size=8 # Adjust based on your GPU memory
|
132 |
+
)
|
133 |
+
|
134 |
+
# Define the class list to match your model's classes
|
135 |
+
classes = ["crack", "dent", "glass shatter", "lamp broken", "scratch", "tire flat"]
|
136 |
+
|
137 |
+
# Evaluate detections against ground truth
|
138 |
+
eval_results = test_dataset.evaluate_detections(
|
139 |
+
"yolo_predictions", # Field containing model predictions
|
140 |
+
gt_field="segmentations", # Field containing ground truth
|
141 |
+
eval_key="model_eval", # Key to store evaluation results
|
142 |
+
use_masks=True, # Use pixel masks for IoU calculation
|
143 |
+
compute_mAP=True, # Compute mean Average Precision
|
144 |
+
method="coco", # COCO evaluation protocol
|
145 |
+
classes=classes, # Class list
|
146 |
+
iou=0.50 # IoU threshold
|
147 |
+
)
|
148 |
+
|
149 |
+
# Print evaluation results
|
150 |
+
print(eval_results)
|
151 |
+
|
152 |
+
# Visualize evaluation results in the FiftyOne App
|
153 |
+
from fiftyone import ViewField as F
|
154 |
+
|
155 |
+
# Create a view showing false positives with high confidence
|
156 |
+
high_conf_fp_view = test_dataset.filter_labels(
|
157 |
+
"yolo_predictions",
|
158 |
+
(F("confidence") > 0.7) & (F("eval") == "fp")
|
159 |
+
)
|
160 |
+
|
161 |
+
# Sort by false positive count
|
162 |
+
sorted_view = high_conf_fp_view.sort_by(
|
163 |
+
F("yolo_predictions.detections").length(), reverse=True
|
164 |
+
)
|
165 |
+
|
166 |
+
# Launch the app with this view
|
167 |
+
session = fo.launch_app(sorted_view)
|
168 |
+
```
|
169 |
+
|
170 |
## Limitations
|
171 |
|
172 |
- Lower recall for crack detection (36.8%)
|