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 的分辨率。
在 YOLO26-Depth 中的作用#
DIODE 是 Ultralytics YOLO26-Depth 多数据集预训练混合数据中约 219 万个图像–深度对的训练数据源。它提供高精度稠密真值,在单个传感器内连接室内和室外领域,帮助模型在近距离和远距离场景之间实现泛化。最终模型会在标准 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")使用方法#
要在 DIODE 数据集上以 640 的图像尺寸训练 YOLO26n-depth 模型,你可以使用以下代码片段。如需查看可用参数的完整列表,请参阅模型的训练页面。
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n-depth.pt") # load a pretrained depth model (recommended for training)
# Train the model
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),在保持 3.9 毫米分辨率的同时,涵盖了Ultralytics 深度数据集格式中所述的全部 80 米室外范围。