SUN RGB-D 深度数据集#
SUN RGB-D 是一个真实世界室内场景理解基准数据集,使用四种不同的 RGB-D 传感器采集:Intel RealSense、Asus Xtion 以及 Microsoft Kinect v1 和 v2。其多传感器设计使其成为用于单目深度估计的宝贵真实室内深度多样性来源。
在 Ultralytics Platform 上探索 SUN RGB-D,预览其 RGB-深度图像对、检查数据集统计信息,并克隆数据集以进行训练。
主要特性#
- 使用四种不同的 RGB-D 传感器采集(Intel RealSense、Asus Xtion、Microsoft Kinect v1 和 v2),提供真实的多传感器多样性。
- 涵盖广泛的真实室内场景,适用于场景理解研究。
- 深度范围最高约为 10 m,符合消费级室内 RGB-D 采集的典型范围。
- 与 RGB 帧对齐的传感器生成深度真值。
- 为 Ultralytics 深度预训练组合提供真实的多传感器室内多样性。
数据集结构#
SUN RGB-D 深度数据集分为两个子集:
- 训练集:9,245 张带有配对深度图的图像,用于训练。
- 验证集:1,090 张带有配对深度图的图像,用于模型训练期间的验证。
每个样本包含一张 RGB 图像和一张配对的缩放 uint16 深度 PNG,遵循 Ultralytics 深度数据集格式。内置转换会写入毫米值,因此会应用默认的 depth_scale: 1000。
在 YOLO26-Depth 中的作用#
SUN RGB-D 是 Ultralytics YOLO26-Depth 多数据集预训练组合中的一个训练来源,该组合大约包含 219 万个图像–深度对。它提供真实的多传感器室内多样性,使模型能够接触到由多种不同消费级 RGB-D 设备采集的深度数据。最终模型会在标准的 NYU、KITTI、Make3D、ETH3D 和 iBims-1 基准数据集上进行评估。
数据集 YAML#
使用 YAML 文件来定义数据集配置。它包含有关数据集路径、类别和其他相关信息。
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
# SUN RGB-D dataset for monocular depth estimation — real indoor, multi-sensor RGB-D (RealSense/Xtion/Kinect), up to ~10 m
# Documentation: https://docs.ultralytics.com/datasets/depth/sunrgbd
# Example usage: yolo depth train data=depth-sunrgbd.yaml model=yolo26n-depth.pt
# parent
# ├── ultralytics
# └── datasets
# └── depth-sunrgbd ← downloads here (6.5 GB archive, ~14 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-sunrgbd dir and re-run to rebuild it.
path: depth-sunrgbd # dataset root dir (relative to Ultralytics settings 'datasets_dir')
train: images/train # train images (relative to 'path') 9245 images
val: images/val # val images (relative to 'path') 1090 images
nc: 1
names:
0: depth
channels: 3
# Download script/URL (optional)
download: |
import random
import shutil
from pathlib import Path
import cv2
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 archive (~6.5 GB), then convert each of the 10335 scenes:
# refined depth_bfx PNGs decode via the SUN RGB-D bit-rotation (d>>3 | d<<13) to millimeters,
# clipped at 10 m; a deterministic random 1090-scene subset (seed 0) forms the val split
dir = Path(yaml["path"]) # dataset root dir
download(["https://rgbd.cs.princeton.edu/data/SUNRGBD.zip"], dir=dir / "source", delete=True, exist_ok=True)
for split in ("train", "val"):
(dir / "images" / split).mkdir(parents=True, exist_ok=True)
(dir / "depth" / split).mkdir(parents=True, exist_ok=True)
scenes = sorted(p.parent for p in (dir / "source" / "SUNRGBD").rglob("depth_bfx"))
names = ["_".join(s.relative_to(dir / "source" / "SUNRGBD").parts) for s in scenes]
val = set(random.Random(0).sample(names, k=1090))
for scene, name in TQDM(zip(scenes, names), total=len(scenes), desc="Converting"):
split = "val" if name in val else "train"
d = cv2.imread(str(next((scene / "depth_bfx").glob("*.png"))), cv2.IMREAD_ANYDEPTH)
d = (((d >> 3) | (d << 13)) / 1000.0).clip(max=10).astype(np.float32) # bit-rotated mm -> m
save_depth_png(dir / "depth" / split / f"{name}.png", d)
next((scene / "image").glob("*.jpg")).replace(dir / "images" / split / f"{name}.jpg")
shutil.rmtree(dir / "source")使用方法#
要在 SUN RGB-D 数据集上以 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-sunrgbd.yaml", epochs=100, imgsz=640)预训练模型#
YOLO26 深度模型系列基于广泛的多数据集深度预训练组合进行训练,SUN RGB-D 就是其中的一部分。这些模型会从最新的 Ultralytics 版本自动下载,例如从 v8.4.0 下载 YOLO26x-depth,并提供多种尺寸,以满足不同的精度和资源需求。
引用和致谢#
如果你在研究或开发工作中使用 SUN RGB-D 数据集,请引用以下论文:
@inproceedings{song2015sunrgbd,
title={SUN RGB-D: A RGB-D Scene Understanding Benchmark Suite},
author={Song, Shuran and Lichtenberg, Samuel P. and Xiao, Jianxiong},
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
year={2015}
}我们谨此感谢创建和维护这一宝贵资源的作者,他们为计算机视觉社区作出了贡献。
常见问题#
SUN RGB-D 是一个真实世界的室内场景理解基准,由四个 RGB-D 传感器捕获:Intel RealSense、Asus Xtion 以及 Microsoft Kinect v1 和 v2。Ultralytics 配置提供了 9,245 个训练图像-深度对和 1,090 个验证图像-深度对,深度可达约 10 米。
每张 RGB 图像都配有一个以毫米为单位的 uint16 PNG,因此默认的
depth_scale: 1000会适用,遵循 Ultralytics depth dataset format。紧凑的 Depth8 测试数据集是从 SUN RGB-D 中抽样得到的,并使用相同的格式。运行
yolo depth train data=depth-sunrgbd.yaml model=yolo26n-depth.pt epochs=100 imgsz=640,或者使用 Usage 部分中的 Python 示例。你还可以在 Ultralytics Platform 上浏览和克隆数据集。



