How daflh/yolo11-distance-estimation works
This repository adapts Ultralytics YOLO11 for monocular distance estimation: detections include class, bounding box, and real-world distance from a single RGB image. The documented workflow prepares KITTI labels, trains the modified model, evaluates detection and distance accuracy, then runs inference or exports for edge deployment. The graph preserves the shared Ultralytics data, model, and engine layers alongside the distance-specific stages. Source excerpts do not show the customized head or training call paths, so those links rely on README statements; unsampled details are not inferred.
Main entry points: predictor.py Inference Engine · dataset.py Dataset Loading · model.py YOLO Model API · tasks.py YOLO Model Graph
Components 18
Distance Model
- YOLO Model Graph
ultralytics/nn/tasks.py - Distance Head
ultralytics/nn/modules/head.py - Distance Loss
ultralytics/utils/loss.py
KITTI Data
- KITTI Label Conversion
scripts/convert_KITTI_to_YOLOv11_labels.py - Dataset Loading
ultralytics/data/dataset.py - Image Augmentation
ultralytics/data/augment.py
Model Runtime
- YOLO Model API
ultralytics/engine/model.py - Training Engine
ultralytics/engine/trainer.py - Validation Engine
ultralytics/engine/validator.py - Inference Engine
ultralytics/engine/predictor.py - Inference Backend
ultralytics/nn/autobackend.py - Prediction Results
ultralytics/engine/results.py
Evaluation & Deployment
- Distance Metrics
ultralytics/utils/metrics.py - Model Export
ultralytics/engine/exporter.py - Performance Benchmark
ultralytics/utils/benchmarks.py - NCNN Inference Example
model_ncnn_infer.py
Other components
- Engineer
- RGB Camera / Images
Connections 18
- Engineer → KITTI Label Conversion: prepares labels
- KITTI Label Conversion → Dataset Loading: provides labels
- Engineer → YOLO Model API: trains model
- Dataset Loading → Training Engine: supplies training data
- Image Augmentation → Dataset Loading: augments samples
ultralytics/data/augment.py - Training Engine → YOLO Model Graph: trains
- YOLO Model Graph → Distance Head: includes distance branch
- Distance Head → Distance Loss: optimizes with WMSE
- Engineer → Validation Engine: evaluates model
- Validation Engine → Distance Metrics: reports distance errors
ultralytics/utils/metrics.py - Engineer → RGB Camera / Images: provides RGB input
- Engineer → YOLO Model API: runs inference
- YOLO Model API → Inference Engine: dispatches prediction
- Inference Engine → Inference Backend: runs model
- Inference Engine → Prediction Results: returns predictions
- Engineer → Model Export: exports model
- Engineer → Performance Benchmark: measures performance
- Engineer → NCNN Inference Example: runs edge inference