DIODE 深度数据集#
DIODE(Dense Indoor/Outdoor DEpth)是一个真实世界数据集,包含使用 FARO Focus 测量级激光扫描仪捕获的高质量致密深度真值。独特的是,它用相同的传感器覆盖了室内和室外场景,使其成为单目深度估计中连接短距离室内和长距离室外深度的高精度桥梁。
主要特性#
- 来自 FARO Focus 测量级激光扫描仪的高质量 密集 深度真值。
- 覆盖了使用相同传感器捕获的 室内和室外 场景。
- 深度范围跨越短程室内距离到远程室外距离,在 Ultralytics 组合中可达约 80 米。
- 与 RGB 帧对齐的密集、精确的逐像素真值。
- 提供连接室内和室外领域的高精度密集真值。
数据集结构#
DIODE 深度数据集被分为两个子集:
- Train:25,458 张用于训练的图像,配有深度图。
- Val:771 张图像,配有用于模型训练期间验证的深度图。
每个样本包含一个 RGB 图像和一个配对的 .npy float32 深度图,以米为单位存储每个像素的距离,遵循 Ultralytics 深度数据集格式。
在 YOLO26-Depth 中的作用#
DIODE 是 Ultralytics YOLO26-Depth 多数据集预训练组合(约 219 万对图像-深度数据)中的一个 训练 源。它贡献了高精度的密集真值,在单个传感器内连接了室内和室外领域,帮助模型在短程和远程场景中实现泛化。所得模型在标准的 NYU、KITTI、Make3D、ETH3D 和 iBims-1 基准测试上进行评估。
数据集 YAML#
YAML (Yet Another Markup Language) 文件用于定义数据集配置。它包含有关数据集路径、类别和其他相关信息。
ultralytics/cfg/datasets/depth-diode.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 *.npy, float32 meters (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
# Download script/URL (optional)
download: |
import shutil
from pathlib import Path
import numpy as np
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>/*.npy
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
np.save(dir / "depth" / split / f"{name[:-4]}.npy", depth.clip(max=80))
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 depth 系列在 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}
}我们感谢作者为计算机视觉社区创建并维护了这一宝贵的资源。