Hypersim 深度数据集#
Hypersim 是一个逼真的室内场景合成数据集,旨在实现全面的室内场景理解。其图像基于专业制作的 Evermotion 3D 室内场景进行光线追踪生成,并配有高度逼真的渲染结果和完美、密集的逐像素深度真值。
由于 Hypersim 完全由合成数据构成,每个像素都有精确的深度值,不存在传感器噪声、缺失回波或测量伪影。这使其成为训练单目深度估计模型的优质干净、密集室内几何数据来源。
主要特性#
- 逼真的合成室内场景,基于专业 Evermotion 3D 室内场景进行光线追踪生成。
- 仅包含室内环境。
- 密集、完美的逐像素深度真值,不含传感器噪声或缺失值。
- 深度范围主要为**≤10 m**(部分距离更大)。
- 为 Ultralytics 深度训练混合数据集贡献74,619张图像(68,242 张训练图像 / 6,377 张验证图像)。
数据集结构#
Hypersim 深度数据集分为两个子集:
- 训练集:68,242 张图像,每张都配有对应的密集深度图,用于训练。
- 验证集:6,377 张图像,每张都配有对应的密集深度图,用于训练期间的验证。
每张 RGB 图像都对应一个经过缩放的 uint16 深度 PNG 文件,遵循 Ultralytics 深度数据集格式。
获取数据#
Hypersim 不支持自动下载——该数据集(按场景划分的 ZIP 文件总计约~1.9 TB)由 Apple 根据 CC BY-SA 3.0 许可发布,并使用 ml-hypersim 代码库中的官方脚本下载(contrib/99991 中提供了选择性下载器):
git clone https://github.com/apple/ml-hypersim && cd ml-hypersim
python code/python/tools/dataset_download_images.py --downloads_dir ./downloads --decompress_dir ./scenesRGB 帧位于 frame.*.tonemap.jpg 预览文件中,深度数据位于 frame.*.depth_meters.hdf5 中。存储值是到相机中心的光线距离,而不是平面深度——保存前请进行转换,并将 NaN 像素(窗户、天空)映射为 0(无效值)。使用官方的 metadata_images_split_scene_v1.csv 场景划分进行训练集/验证集分配。转换为 Ultralytics 深度数据集格式的参考实现:
import shutil
from pathlib import Path
import h5py
import numpy as np
from ultralytics.data.utils import save_depth_png
W, H, FOCAL = 1024, 768, 886.81 # Hypersim camera intrinsics
x, y = np.meshgrid(np.linspace(-W / 2, W / 2, W), np.linspace(-H / 2, H / 2, H))
ray2plane = (FOCAL / np.sqrt(x**2 + y**2 + FOCAL**2)).astype(np.float32) # distance → planar depth
src, dst = Path("scenes"), Path("datasets/depth-hypersim")
out = "train" # assign per scene from metadata_images_split_scene_v1.csv
(dst / f"images/{out}").mkdir(parents=True, exist_ok=True)
(dst / f"depth/{out}").mkdir(parents=True, exist_ok=True)
for h5 in sorted(src.rglob("*.depth_meters.hdf5")):
scene, cam, frame = h5.parts[-4], h5.parent.name.split("_geometry")[0], h5.name.split(".")[1]
rgb = h5.parents[1] / f"{cam}_final_preview" / f"frame.{frame}.tonemap.jpg"
dist = np.asarray(h5py.File(h5)["dataset"], np.float32)
depth = np.nan_to_num(dist * ray2plane, nan=0.0) # NaN (sky, glass) → 0 = invalid
name = f"{scene}_{cam}_{frame}"
save_depth_png(dst / f"depth/{out}/{name}.png", depth)
shutil.copy(rgb, dst / f"images/{out}/{name}.jpg")在 YOLO26-Depth 中的作用#
Hypersim 是用于预训练 Ultralytics YOLO26-Depth 模型的广泛多数据集混合数据(约~219 万张图像)中的一个训练数据源。在该混合数据中,Hypersim 提供了干净、密集的室内几何信息,可补充噪声更大的真实世界传感器数据。
在此设置中,没有单独留出的 Hypersim 基准测试集。相反,最终模型会在标准单目深度基准上进行评估:NYU Depth V2、KITTI、Make3D、ETH3D 和 iBims-1。
数据集 YAML#
使用 YAML 文件来定义数据集配置。它包含有关数据集路径、类和其他相关信息的信息。对于 Hypersim,depth-hypersim.yaml 文件定义了路径和单个 depth 类。
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
# Hypersim dataset for monocular depth estimation — photorealistic synthetic indoor (ray-traced), dense depth up to ~10 m
# Documentation: https://docs.ultralytics.com/datasets/depth/hypersim
# Example usage: yolo depth train data=depth-hypersim.yaml model=yolo26n-depth.pt
# No autodownload — obtain the source data (see docs) and arrange it as below.
# parent
# ├── ultralytics
# └── datasets
# └── depth-hypersim
# ├── images/{train,val} # RGB images
# └── depth/{train,val} # paired 16-bit *.png depth maps (images/ -> depth/)
path: depth-hypersim # dataset root dir (relative to Ultralytics settings 'datasets_dir')
train: images/train # train images (relative to 'path') 68242 images
val: images/val # val images (relative to 'path') 6377 images
nc: 1
names:
0: depth
channels: 3使用方法#
要在 Hypersim 数据集上使用 640 的图像尺寸训练 YOLO26n-Depth 模型,可以使用以下代码片段。如需查看可用参数的完整列表,请参阅模型训练页面。
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n-depth.pt") # load a pretrained model (recommended for training)
# Train the model
results = model.train(data="depth-hypersim.yaml", epochs=100, imgsz=640)预训练模型#
YOLO26 深度系列(yolo26n-depth.pt、yolo26s-depth.pt、yolo26m-depth.pt、yolo26l-depth.pt、yolo26x-depth.pt)会从 Ultralytics 发布版本中自动下载,并在包含 Hypersim 的广泛多数据集混合数据上进行训练。在 Ultralytics Platform 上探索 YOLO26x-depth。
引用和致谢#
如果你在研究或开发工作中使用 Hypersim 数据集,请引用以下论文:
@inproceedings{roberts2021hypersim,
title={Hypersim: A Photorealistic Synthetic Dataset for Holistic Indoor Scene Understanding},
author={Mike Roberts and Jason Ramapuram and Anurag Ranjan and Atulit Kumar and Miguel Angel Bautista and Nathan Paczan and Russ Webb and Joshua M. Susskind},
booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
year={2021}
}我们感谢 Hypersim 的创建者将这个逼真的合成室内数据集提供给计算机视觉社区。
常见问题#
Hypersim 是 Apple 推出的逼真合成室内数据集,由专业的 Evermotion 3D 室内场景光线追踪生成。由于每个像素都有一个精确的深度值,且没有传感器噪声或漏回波,其 74,619 张图像(68,242 张用于训练,6,377 张用于验证)提供了干净、密集的室内几何结构,这与 YOLO26-Depth 训练组合中噪声较多的现实世界传感器数据相辅相成。
Hypersim 没有自动下载功能。使用 ml-hypersim repository 中的官方脚本获取场景(约 1.9 TB),然后使用 Obtain the Data 中的脚本将
depth_meters.hdf5光线距离转换为平面深度并写入毫米级 PNG。将诸如窗户和天空等 NaN 像素映射到0,以便将其视为无效像素。