YOLO-Depth: metric per-pixel distance from a single camera
YOLO-Depth brings monocular depth estimation to Ultralytics YOLO: a metric distance in meters for every pixel, recovered from a single RGB image, using the same familiar ultralytics Python and CLI workflows.
This is the launch hub for YOLO26 depth estimation models, datasets, outputs, and examples.
What shipped
- New depth estimation task:
depth - YOLO26 depth model family:
yolo26n-depth.pt,yolo26s-depth.pt,yolo26m-depth.pt,yolo26l-depth.pt,yolo26x-depth.pt - Dense metric depth outputs through
result.depth - Unbounded log-depth head (~0.02–150 m), so one model covers tabletop and highway ranges alike
- Closed-form scale calibration through
model.calibrate(), already baked into the released weights - Built-in dataset configs for NYU Depth V2, KITTI, Hypersim, SUN RGB-D, ARKitScenes, DIODE, TartanAir, and vKITTI2
- Train, val, predict, and export workflows through the standard Ultralytics API
Start here
- Depth estimation task docs: https://docs.ultralytics.com/tasks/depth
- Depth dataset format: https://docs.ultralytics.com/datasets/depth
- Depth8 quick test dataset: https://docs.ultralytics.com/datasets/depth/depth8
- NYU Depth V2 dataset: https://docs.ultralytics.com/datasets/depth/nyu-depth-v2
- Depth results output: https://docs.ultralytics.com/tasks/depth#results-output
- YOLO26 model docs: https://docs.ultralytics.com/models/yolo26
- Main repository: https://github.com/ultralytics/ultralytics
- Roadmap: https://www.ultralytics.com/roadmap
Quickstart: CLI
pip install -U ultralytics
# Predict a dense metric depth map
yolo depth predict model=yolo26n-depth.pt source=https://ultralytics.com/images/bus.jpg imgsz=768
# Train on the tiny Depth8 smoke-test dataset
yolo depth train data=depth8.yaml model=yolo26n-depth.pt epochs=10 imgsz=640
# Validate on NYU Depth V2
yolo depth val model=yolo26n-depth.pt data=nyu-depth.yaml imgsz=768
# Export for deployment
yolo export model=yolo26n-depth.pt format=onnx imgsz=768
Quickstart: Python
from ultralytics import YOLO
model = YOLO("yolo26n-depth.pt")
results = model.predict("https://ultralytics.com/images/bus.jpg", imgsz=768)
for result in results:
depth = result.depth.data.cpu().numpy() # H x W float32 map, meters
print(depth.shape)
print(depth.min(), depth.max())
Training from custom data
Depth datasets pair each RGB image with a .npy float32 depth map in meters. The loader derives the depth path by replacing the images component with depth and swapping the image extension for .npy.
dataset/
├── images/{train,val}
└── depth/{train,val}
Dataset YAML
path: /path/to/my-depth-dataset
train: images/train
val: images/val
max_depth: 80 # (m) optional, GT beyond this is excluded from val metrics
nc: 1
names:
0: depth
yolo depth train data=my-depth.yaml model=yolo26n-depth.pt epochs=100 imgsz=640
Fine-tuning recipe
The released weights are already converged, so fine-tune them with AdamW and a low learning rate instead of the from-scratch SGD defaults:
yolo depth train data=my-depth.yaml model=yolo26s-depth.pt \
epochs=20 imgsz=640 optimizer=AdamW lr0=1e-4 warmup_bias_lr=1e-4
mosaic, mixup, cutmix, and copy_paste are disabled for depth — they combine multiple images, which would produce invalid paired depth maps. Every other augmentation argument applies the same warp to the image and its depth map.
Calibrating the scale
The head separates scene shape from absolute scale. If relative depth already looks right but the meters are off for your camera, refit the scale in seconds — a closed-form two-parameter fit, no gradient training and no change to the network weights:
from ultralytics import YOLO
model = YOLO("yolo26s-depth.pt")
model.calibrate(data="my-depth.yaml") # needs a labeled split
model.save("yolo26s-depth-calibrated.pt")
Why it matters
Depth estimation answers a question detection and segmentation cannot: how far away is it. Monocular depth answers it with no stereo rig, no LiDAR, and no calibration setup — one camera in, a full metric map out. That fits robotics and drone navigation, driver assistance, AR/VR occlusion, volumetric measurement, and single-image 3D reconstruction.
The models are built for deployment, not just benchmarks. On a Tesla T4 under TensorRT fp16 at ~768 px, YOLO26n-depth runs in 2.73 ms and YOLO26x-depth in 13.57 ms — both faster than Depth Anything V2 Small at 20.99 ms.
Use YOLO-Depth when you need distance per pixel. Use detection, instance segmentation, or semantic segmentation when you need what the pixels are rather than how far they are.
Share feedback here for YOLO-Depth docs, examples, dataset format questions, and workflows that should be easier to discover.
Source: ultralytics/ultralytics