Link to this sectionDataset KITTI Depth#
Il dataset KITTI è un benchmark del mondo reale per la guida autonoma acquisito da un veicolo in movimento all'interno e nei dintorni della città di Karlsruhe. Per la stima della profondità monoculare, la profondità ground-truth è derivata da uno scanner LiDAR Velodyne HDL-64 e densificata utilizzando il metodo di Uhrig et al. 2017. Le mappe di profondità risultanti rimangono sparse, con circa il 16-20% dei pixel che contengono un valore di profondità valido. KITTI è l'unica fonte reale all'aperto a lungo raggio nel mix di pre-addestramento YOLO26-Depth e funge anche da benchmark di valutazione KITTI Eigen.
Link to this sectionCaratteristiche principali#
- Scene di guida reali all'aperto con profondità che arrivano fino a circa 80 m, ben oltre il tipico raggio d'azione al chiuso.
- Ground truth di profondità ottenuto da un LiDAR Velodyne HDL-64 e densificato con l'approccio Sparsity Invariant CNNs di Uhrig et al. 2017.
- Supervisione sparsa: solo circa il 16-20% dei pixel per immagine contiene un valore di profondità valido; i pixel non validi vengono esclusi dalla loss e dalle metriche.
- Le coppie di immagini stereo (sinistra
image_02e destraimage_03) forniscono punti di vista aggiuntivi per l'addestramento. - I valori di profondità sono memorizzati come array float32
.npyin metri, seguendo il formato del dataset di profondità Ultralytics.
Link to this sectionStruttura del dataset#
I dati di profondità KITTI utilizzati da Ultralytics sono suddivisi in due sottoinsiemi:
- Split di addestramento: 60.040 immagini (sinistra
image_02e destraimage_03). I 28 test drive KITTI Eigen sono esclusi dall'addestramento per mantenere equa la valutazione. - Split di valutazione: lo split di test KITTI Eigen, 32.378 immagini (entrambe le telecamere). La valutazione utilizza il ritaglio Garg, un limite di profondità di 80 m e un allineamento log-least-squares tra le predizioni e il ground truth.
Il range di profondità raggiunge circa 80 m e il file YAML del dataset (depth-kitti.yaml) imposta max_depth: 80 di conseguenza.
Link to this sectionRuolo in YOLO26-Depth#
KITTI fornisce l'unica supervisione reale all'aperto a lungo raggio nel mix di pre-addestramento YOLO26-Depth, completando le fonti prevalentemente al chiuso. È anche il benchmark standard KITTI Eigen per riportare l'accuratezza della profondità nelle scene di guida.
KITTI è un esempio chiave del perché la head di profondità non è limitata (modalità log): un limite di output fisso a 10 m non può rappresentare scene di guida a 80 m. Vedi la pagina del task depth per dettagli sul range di output della head e sulla gestione di max_depth.
Link to this sectionRisultati#
Accuratezza delta1 di KITTI Eigen per dimensione del modello (più alto è meglio):
| Modello | KITTI Eigen δ1 |
|---|---|
| YOLO26n-Depth | 0.888 |
| YOLO26s-Depth | 0.882 |
| YOLO26m-Depth | 0.924 |
| YOLO26l-Depth | 0.927 |
| YOLO26x-Depth | 0.939 |
Link to this sectionDataset YAML#
Un file YAML (Yet Another Markup Language) viene utilizzato per definire la configurazione del dataset. Contiene informazioni sui percorsi del dataset, le classi e altre informazioni rilevanti come la profondità massima.
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
# KITTI dataset for monocular depth estimation — real outdoor driving, Velodyne HDL-64 LiDAR (densified), sparse, up to ~80 m
# Documentation: https://docs.ultralytics.com/datasets/depth/kitti
# Example usage: yolo depth train data=depth-kitti.yaml model=yolo26n-depth.pt
# parent
# ├── ultralytics
# └── datasets
# └── depth-kitti ← downloads here (~190 GB archives, ~230 GB converted)
# ├── images/{train,val} # RGB images
# └── depth/{train,val} # paired *.npy, float32 meters (images/ -> depth/)
# If an interrupted download leaves a partial dataset, delete the depth-kitti dir and re-run to rebuild it.
path: depth-kitti # dataset root dir (relative to Ultralytics settings 'datasets_dir')
train: images/train # train images (relative to 'path') 60040 images
val: images/val # val images (relative to 'path') 32378 images (KITTI Eigen test split)
max_depth: 80 # (m) maximum valid depth; GT beyond this is excluded from val metrics
nc: 1
names:
0: depth
channels: 3
# Download script/URL (optional)
download: |
import shutil
from pathlib import Path
import cv2
import numpy as np
from ultralytics.utils import TQDM
from ultralytics.utils.downloads import download
# Drives of the 28 KITTI Eigen test scenes -> val; every other annotated drive -> train
VAL_DRIVES = """2011_09_26_drive_0002 2011_09_26_drive_0009 2011_09_26_drive_0013 2011_09_26_drive_0020
2011_09_26_drive_0023 2011_09_26_drive_0027 2011_09_26_drive_0029 2011_09_26_drive_0036 2011_09_26_drive_0046
2011_09_26_drive_0048 2011_09_26_drive_0052 2011_09_26_drive_0056 2011_09_26_drive_0059 2011_09_26_drive_0064
2011_09_26_drive_0084 2011_09_26_drive_0086 2011_09_26_drive_0093 2011_09_26_drive_0096 2011_09_26_drive_0101
2011_09_26_drive_0106 2011_09_26_drive_0117 2011_09_28_drive_0002 2011_09_29_drive_0026 2011_09_29_drive_0071
2011_09_30_drive_0016 2011_10_03_drive_0034 2011_10_03_drive_0042 2011_10_03_drive_0047""".split()
# Annotated drives excluded from the release training set (raw data was unavailable at build time)
SKIP_DRIVES = {"2011_09_28_drive_0104", "2011_09_28_drive_0135", "2011_09_28_drive_0177", "2011_09_28_drive_0214"}
# Download the improved sparse GT (~14 GB) and the raw recordings it covers (~175 GB)
dir = Path(yaml["path"]) # dataset root dir
base = "https://s3.eu-central-1.amazonaws.com/avg-kitti"
download([f"{base}/data_depth_annotated.zip"], dir=dir / "source", delete=True, exist_ok=True)
gt_drives = sorted(p for p in (dir / "source" / "data_depth_annotated").glob("*/*_sync") if p.name[:-5] not in SKIP_DRIVES)
urls = [f"{base}/raw_data/{p.name[:-5]}/{p.name}.zip" for p in gt_drives]
download(urls, dir=dir / "source" / "raw", delete=True, exist_ok=True, threads=4)
# Convert: GT PNGs are uint16 meters*256; RGB frames come from the matching raw drive
for split in ("train", "val"):
(dir / "images" / split).mkdir(parents=True, exist_ok=True)
(dir / "depth" / split).mkdir(parents=True, exist_ok=True)
for gt in TQDM(gt_drives, desc="Converting"):
drive = gt.name[:-5] # 2011_09_26_drive_0002
split = "val" if drive in VAL_DRIVES else "train"
for cam in ("image_02", "image_03"):
for png in sorted((gt / "proj_depth" / "groundtruth" / cam).glob("*.png")):
name = f"{drive}_{cam[-2:]}_{png.stem}"
depth = cv2.imread(str(png), cv2.IMREAD_ANYDEPTH).astype(np.float32) / 256.0
np.save(dir / "depth" / split / f"{name}.npy", depth)
raw = dir / "source" / "raw" / drive[:10] / gt.name / cam / "data" / png.name
raw.replace(dir / "images" / split / f"{name}.png")
shutil.rmtree(dir / "source")Link to this sectionUtilizzo#
Per addestrare un modello YOLO26n-Depth sul dataset KITTI per 100 epoche, puoi utilizzare i seguenti frammenti di codice. Per un elenco completo degli argomenti disponibili, consulta la pagina Training del modello.
from ultralytics import YOLO
# Load a pretrained depth model
model = YOLO("yolo26n-depth.pt")
# Train the model on KITTI
results = model.train(data="depth-kitti.yaml", epochs=100, imgsz=640)Link to this sectionModelli pre-addestrati#
I modelli YOLO26-Depth pre-addestrati si scaricano automaticamente dal rilascio degli asset v8.4.0 di Ultralytics quando vengono referenziati per nome per la prima volta:
Link to this sectionCitazioni e riconoscimenti#
Se utilizzi il dataset KITTI nel tuo lavoro di ricerca o sviluppo, ti preghiamo di citare i seguenti articoli:
@article{geiger2013vision,
title={Vision meets Robotics: The KITTI Dataset},
author={Geiger, Andreas and Lenz, Philip and Stiller, Christoph and Urtasun, Raquel},
journal={The International Journal of Robotics Research},
year={2013},
publisher={SAGE Publications}
}
@inproceedings{uhrig2017sparsity,
title={Sparsity Invariant CNNs},
author={Uhrig, Jonas and Schneider, Nick and Schneider, Lukas and Franke, Uwe and Brox, Thomas and Geiger, Andreas},
booktitle={International Conference on 3D Vision (3DV)},
year={2017}
}Vorremmo ringraziare il Karlsruhe Institute of Technology e il Toyota Technological Institute at Chicago per aver creato e mantenuto il dataset KITTI, e Uhrig et al. per il metodo di densificazione della profondità che rende possibile la supervisione densa.