Enterprise-ready security: ISO 27001 + SOC 2 Type I compliant.

Link to this sectionDepth Estimation Datasets Overview#

Monocular depth estimation assigns a floating-point depth value in meters to every pixel in an image. The training target is a dense per-pixel depth map stored as a .npy float32 array. Each value represents the distance from the camera to the corresponding scene point.

This guide explains the dataset format used by Ultralytics YOLO depth estimation models and lists the built-in dataset configurations available for training and validation.

Link to this sectionSupported Dataset Format#

Link to this sectionNPY depth map format#

Each training sample consists of one RGB image and one paired .npy depth file. The depth file stores a 2D float32 NumPy array with shape (H, W) where values are depths in meters.

  • Depth files must use the .npy extension and contain a float32 array.
  • Each depth file should have the same stem as its matching image file (e.g., scene_001.npy pairs with scene_001.jpg).
  • The dataset loader finds depth files by replacing the images directory component with depth in the file path and swapping the image extension for .npy.
  • Pixels with depth ≤ 0 are treated as invalid and excluded from loss and metric computation.

The standard layout keeps images and depth maps in parallel folders:

dataset/
├── images/
│   ├── train/
│   └── val/
└── depth/
    ├── train/
    └── val/

For example, an image at images/train/scene_001.jpg is paired with a depth map at depth/train/scene_001.npy.

Link to this sectionDataset YAML format#

Depth estimation datasets are configured with YAML files. The main fields are:

KeyDescription
pathDataset root directory.
trainTraining image path relative to path, or an absolute path.
valValidation image path relative to path, or an absolute path.
testOptional test image path.
ncNumber of classes — always 1 for depth estimation.
namesClass name mapping — always {0: depth}.
ultralytics/cfg/datasets/nyu-depth.yaml
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license

# NYU Depth V2 dataset for monocular depth estimation
# Documentation: https://cs.nyu.edu/~silberman/datasets/nyu_depth_v2.html
# 795 train + 654 val (Eigen test split) images, 480x640, indoor scenes, depth in meters
# Example usage: yolo depth train data=nyu-depth.yaml model=yolo26n-depth.pt
# parent
# ├── ultralytics
# └── datasets
#     └── nyu-depth  ← downloads here (≈1.5 GB)

# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
path: nyu-depth # dataset root dir (relative to Ultralytics settings 'datasets_dir')
train: images/train # train images (relative to 'path') 795 images
val: images/val # val images (relative to 'path') 654 images

# Depth maps are paired .npy files (float32, meters) under depth/<split>/, resolved by
# swapping '/images/' -> '/depth/' on each image path.

# Classes
nc: 1
names:
  0: depth

channels: 3

# Download script/URL (optional)
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/nyu-depth.zip

Link to this sectionUsage#

Train a YOLO26 depth estimation model with Python or CLI:

Example
from ultralytics import YOLO

# Load a pretrained depth model
model = YOLO("yolo26n-depth.pt")

# Train on the NYU Depth V2 dataset
results = model.train(data="nyu-depth.yaml", epochs=100, imgsz=640)

Link to this sectionSupported Datasets#

The YOLO26 depth models are pretrained on a broad multi-dataset mix (~2.19M images) spanning indoor (≤10 m) to outdoor (~80 m) ranges, then evaluated zero-shot across five benchmarks. Each dataset has a dedicated page:

Debugging

  • Depth8 — 8 SUN RGB-D images in a 1.3 MB auto-downloading archive, for rapid pipeline testing

Pretraining sources

  • ARKitScenes — real indoor, Apple ARKit LiDAR (largest real source)
  • SUN RGB-D — real indoor, multi-sensor RGB-D
  • DIODE — real indoor + outdoor, dense laser-scanner ground truth
  • Hypersim — synthetic photorealistic indoor
  • TartanAir — synthetic, diverse environments
  • Virtual KITTI 2 — synthetic outdoor driving
  • KITTI — real outdoor driving, Velodyne LiDAR (also an evaluation benchmark)
  • ImageNet (pseudo-labeled) — pseudo-labeled distillation set, the largest single source

Evaluation benchmarks

  • NYU Depth V2 — primary indoor benchmark
  • KITTI Eigen — outdoor driving benchmark
  • ETH3D — high-precision indoor + outdoor
  • Make3D — outdoor, out-of-distribution
  • iBims-1 — high-quality indoor (edges and planar surfaces)

Per-model accuracy on these benchmarks and the downloadable pretrained weights are listed on the Depth Estimation task page. A dataset YAML whose train field lists multiple image directories combines these sources for large-scale mixed training.

Link to this sectionAdding Your Own Dataset#

  1. Save RGB images under split folders such as images/train and images/val.
  2. Save one .npy float32 depth array per image under the matching depth/train and depth/val folders using the same file stem as the image.
  3. Ensure depth values are in meters and that invalid or missing pixels use 0 or negative values.
  4. Create a dataset YAML with path, train, val, nc: 1, and names: {0: depth}.
path: path/to/my-depth-dataset
train: images/train
val: images/val

nc: 1
names:
    0: depth

Link to this sectionFAQ#

Link to this sectionWhat file format should depth maps use?#

Depth maps must be saved as NumPy .npy files containing float32 arrays of shape (H, W). Each element stores the depth in meters for the corresponding image pixel. Do not use PNG or 16-bit integer formats — the loader expects raw float arrays.

Link to this sectionHow are invalid depth pixels handled?#

Pixels with depth values ≤ 0 are treated as invalid and masked out from both loss computation and metric evaluation. This covers sensor noise, sky regions, and reflective surfaces where depth cannot be reliably measured.

Link to this sectionWhat metrics are used for evaluation?#

Depth estimation validation reports the standard Depth Anything metric set:

  • delta1 / delta2 / delta3 — percentage of pixels within 1.25×, 1.25²×, 1.25³× thresholds. Higher is better.
  • abs_rel — mean absolute relative error. Lower is better.
  • rmse — root mean squared error in meters. Lower is better.
  • silog — scale-invariant logarithmic error. Lower is better.

Link to this sectionDo depth file names need to match image file names?#

Yes. Each depth .npy file must share the same stem as the corresponding image. The loader derives the depth path by replacing the images directory component with depth and substituting the image extension for .npy. Images whose depth file is missing or unreadable are dropped during the (cached) dataset scan with a warning, exactly like corrupt images; if no valid image-depth pairs are found at all, an error is raised.

Contributors

Comments