Link to this sectionSUN RGB-D 深度数据集#
SUN RGB-D 是一个现实世界的室内场景理解基准,由四种不同的 RGB-D 传感器拍摄:Intel RealSense、Asus Xtion 以及 Microsoft Kinect v1 和 v2。其多传感器设计使其成为 单目深度估计 中真实室内深度多样性的宝贵来源。
Link to this section主要特性#
- 由四种不同的 RGB-D 传感器(Intel RealSense、Asus Xtion、Microsoft Kinect v1 和 v2)拍摄,提供了真实的多传感器多样性。
- 涵盖了广泛的真实 室内 场景,用于场景理解研究。
- 深度范围最大约为 10 米,这是消费级室内 RGB-D 拍摄的典型范围。
- 传感器导出的深度地面真值与 RGB 帧对齐。
- 为 Ultralytics 深度预训练组合贡献了真实的室内多传感器多样性。
Link to this section数据集结构#
SUN RGB-D 深度数据集分为两个子集:
- Train:9,245 张带有配对深度图的训练图像。
- Val:1,090 张带有配对深度图的图像,用于模型训练期间的验证。
每个样本包含一张 RGB 图像和一张配对的 .npy float32 深度图,以米为单位存储像素级距离,遵循 Ultralytics 深度数据集格式。
Link to this section在 YOLO26-Depth 中的作用#
SUN RGB-D 是 Ultralytics YOLO26-Depth 多数据集预训练组合中的一个 训练 源,该组合约有 219 万对图像-深度对。它贡献了真实的室内多传感器多样性,使模型能够接触到通过多种不同消费级 RGB-D 设备捕获的深度信息。由此产生的模型将在标准的 NYU、KITTI、Make3D、ETH3D 和 iBims-1 基准上进行评估。
Link to this section数据集 YAML#
YAML (Yet Another Markup Language) 文件用于定义数据集配置。它包含有关数据集路径、类别和其他相关信息。
# 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 *.npy, float32 meters (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.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
np.save(dir / "depth" / split / f"{name}.npy", d)
next((scene / "image").glob("*.jpg")).replace(dir / "images" / split / f"{name}.jpg")
shutil.rmtree(dir / "source")Link to this section用法#
要使用 640 的图像尺寸在 SUN RGB-D 数据集上训练 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)Link to this section预训练模型#
YOLO26 深度系列模型是在 SUN RGB-D 所属的广泛多数据集深度预训练组合上进行训练的。这些模型会从最新的 Ultralytics 版本中自动下载,例如来自 v8.4.0 的 YOLO26x-depth,它们涵盖了各种尺寸以满足不同的精度和资源需求。
Link to this section引用与致谢#
如果你在研究或开发工作中使用了 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}
}我们感谢作者为计算机视觉社区创建并维护了这一宝贵的资源。