DIODE 深度数据集#
DIODE(室内/室外稠密深度)是一个真实场景数据集,使用 FARO Focus 测量级激光扫描仪采集了质量极高的稠密深度真值。其独特之处在于使用同一传感器覆盖室内和室外场景,因此它在单目深度估计中能够以高精度连接短距离室内和长距离室外深度数据。
主要功能#
- 使用 FARO Focus 测量级激光扫描仪采集的质量极高的稠密深度真值。
- 使用同一传感器采集的室内和室外场景均有覆盖。
- 深度范围从较短的室内距离延伸至较长的室外距离;在 Ultralytics 混合数据中,最大约为 80 m。
- 与 RGB 帧对齐的稠密、准确逐像素真值。
- 提供高精度稠密真值,连接室内和室外领域。
数据集结构#
DIODE 深度数据集分为两个子集:
- 训练集:25,458 张图像及其配对深度图,用于训练。
- 验证集:771 张图像及其配对深度图,用于模型训练期间的验证。
每个样本包含一张 RGB 图像和一张配对的 uint16 深度 PNG,每米对应 256 个单位(depth_scale: 256),遵循 Ultralytics 深度数据集格式。这种编码在表示完整 80 m 室外范围的同时,提供 3.90625 mm 的分辨率。数据集 YAML 会下载官方 DIODE 压缩包(~84 GB),并在首次使用时自动将其转换为这种布局。
在 YOLO26-Depth 中的作用#
DIODE 是 Ultralytics YOLO26-Depth 多数据集预训练混合数据中的一个训练数据源,该混合数据约包含 2.19M 个图像-深度图像对。它提供高精度稠密真值,在同一传感器的数据中连接室内和室外领域,帮助模型适应短距离和长距离场景。最终模型会在 NYU、KITTI、Make3D、ETH3D 和 iBims-1 标准基准上进行评估。
数据集 YAML#
数据集配置使用 YAML 文件定义,其中包含数据集路径、类别及其他相关信息。
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
# DIODE dataset for monocular depth estimation — real indoor + outdoor, FARO Focus survey-grade laser, depth up to ~80 m
# Documentation: https://docs.ultralytics.com/datasets/depth/diode
# Example usage: yolo depth train data=depth-diode.yaml model=yolo26n-depth.pt
# parent
# ├── ultralytics
# └── datasets
# └── depth-diode ← downloads here (84 GB archives, ~90 GB converted)
# ├── images/{train,val} # RGB images
# └── depth/{train,val} # paired 16-bit *.png depth maps (images/ -> depth/)
# If an interrupted download leaves a partial dataset, delete the depth-diode dir and re-run to rebuild it.
path: depth-diode # dataset root dir (relative to Ultralytics settings 'datasets_dir')
train: images/train # train images (relative to 'path') 25458 images
val: images/val # val images (relative to 'path') 771 images
max_depth: 80 # (m) maximum valid depth; GT beyond this is excluded from val metrics
nc: 1
names:
0: depth
channels: 3
depth_scale: 256 # PNG value 256 = 1 meter; represents the 80 m outdoor range
# Download script/URL (optional)
download: |
import shutil
from pathlib import Path
import numpy as np
from ultralytics.data.utils import save_depth_png
from ultralytics.utils import TQDM
from ultralytics.utils.downloads import download
# Download and extract the official archives (train ~81 GB, val ~2.6 GB), then convert:
# flatten <split>/<scene>/<scan>/*.png into images/<split>/ and save the paired *_depth.npy
# (masked invalid -> 0, clipped at 80 m) as depth/<split>/*.png
dir = Path(yaml["path"]) # dataset root dir
download([f"https://diode-dataset.s3.amazonaws.com/{s}.tar.gz" for s in ("train", "val")], dir=dir / "source", delete=True)
for split in ("train", "val"):
(dir / "images" / split).mkdir(parents=True, exist_ok=True)
(dir / "depth" / split).mkdir(parents=True, exist_ok=True)
for im in TQDM(sorted((dir / "source" / split).rglob("*.png")), desc=f"Converting {split}"):
name = "_".join(im.relative_to(dir / "source").parts) # train/indoors/scene/scan/x.png -> train_indoors_scene_scan_x.png
depth = np.load(im.with_name(f"{im.stem}_depth.npy")).squeeze().astype(np.float32)
depth[np.load(im.with_name(f"{im.stem}_depth_mask.npy")) == 0] = 0.0 # zero out invalid pixels
save_depth_png(dir / "depth" / split / f"{name[:-4]}.png", depth.clip(max=80), scale=256)
im.replace(dir / "images" / split / name)
shutil.rmtree(dir / "source")用法#
要使用图像尺寸 640 在 DIODE 数据集上训练 YOLO26n-depth 模型,可以使用以下代码示例。可在模型的训练页面查看所有可用参数。
from ultralytics import YOLO
# 加载模型
model = YOLO("yolo26n-depth.pt") # 加载预训练深度模型(推荐用于训练)
# 训练模型
results = model.train(data="depth-diode.yaml", epochs=100, imgsz=640)预训练模型#
YOLO26 深度模型系列基于广泛的多数据集深度预训练混合数据进行训练,DIODE 也是其中的一部分。这些模型首次使用时会从 Ultralytics v8.4.0 资源发布版本自动下载,例如 YOLO26x-depth,并提供多种尺寸,以满足不同的精度和资源需求。
引用与致谢#
如果你在研究或开发工作中使用 DIODE 数据集,请引用以下论文:
@article{vasiljevic2019diode,
title={DIODE: A Dense Indoor and Outdoor DEpth Dataset},
author={Vasiljevic, Igor and Kolkin, Nick and Zhang, Shanyi and Luo, Ruotian and Wang, Haochen and Dai, Falcon Z. and Daniele, Andrea F. and Mostajabi, Mohammadreza and Basart, Steven and Walter, Matthew R. and Shakhnarovich, Gregory},
journal={arXiv preprint arXiv:1908.00463},
year={2019}
}我们感谢作者为计算机视觉社区创建并维护这一宝贵资源。
常见问题#
DIODE 使用同一台 FARO Focus 测量级激光扫描仪采集室内和室外场景,在短距离室内和长距离室外范围内生成极其稠密且准确的深度真值。这种单传感器覆盖使其成为 YOLO26-Depth 训练混合数据中连接室内和室外领域的高精度桥梁。
Ultralytics 配置包含 25,458 个训练图像-深度图像对和 771 个验证图像-深度图像对。深度以每米 256 个单位的 uint16 PNG 格式存储(
depth_scale: 256),在覆盖完整 80 m 室外范围的同时保持 3.9 mm 分辨率;完整范围的说明请参阅 Ultralytics 深度数据集格式。