A comprehensive framework for validating object detection models, with a focus on YOLO models. This framework provides tools for converting YOLO format datasets to CSV, running inference with YOLO models, and calculating detailed evaluation metrics.
- Convert YOLO format datasets to CSV format
- Run inference with YOLO models on image datasets
- Calculate comprehensive evaluation metrics:
- mAP (mean Average Precision) at IoU 0.5 and 0.5:0.95
- Precision-Recall curves
- Per-class metrics (AP, Precision, Recall, F1)
- Confidence threshold analysis
- Generate detailed evaluation reports and visualizations
pip install -r requirements.txt
Convert your YOLO format dataset to CSV format for evaluation:
python data/yolo2csv.py \
--images_list path/to/images.txt \
--output output.csv \
--class_names path/to/classes.txt
Run inference with your YOLO model:
python inference/yolo_infer.py \
--weights path/to/model.pt \
--txt_path path/to/images.txt \
--output_dir results \
--device 0 \
--cfg path/to/config.yaml
Calculate evaluation metrics:
python validation/val.py \
--gt path/to/ground_truth.csv \
--pred path/to/predictions.csv \
--output_dir results \
--save_csv True \
--conf_thresholds "0.1,0.25,0.5,0.75,0.9"
The evaluation script generates:
- Detailed per-class metrics in CSV format
- Precision-Recall curves visualization
- Overall metrics including mAP, precision, recall, and F1 scores
- Confidence threshold analysis
- Python 3.7+
- PyTorch
- OpenCV
- Pandas
- NumPy
- Matplotlib
- Ultralytics YOLO