Ultralytics YOLO27:
Get Started

Hypersim 深度数据集#

Hypersim 是一个逼真的合成室内场景数据集,旨在全面理解室内场景。其图像由专业制作的 Evermotion 3D 室内场景进行光线追踪生成,呈现高度逼真的渲染效果,并配有精确、稠密的逐像素深度真值。

Hypersim 完全由合成数据构成,因此每个像素都有精确的深度值,不存在传感器噪声、缺失回波或测量伪影。这使它成为训练单目深度估计模型的优质数据源,可提供干净、稠密的室内几何信息。

主要功能#

  • 逼真的合成室内场景,由专业制作的 Evermotion 3D 室内场景进行光线追踪生成。
  • 仅包含室内环境。
  • 稠密、精确的逐像素深度真值,不含传感器噪声或缺失值。
  • 深度范围主要为 ≤10 m(也包含一些更远的距离)。
  • 为 Ultralytics 深度训练混合数据贡献 74,619 张图像(68,242 张训练图像 / 6,377 张验证图像)。

数据集结构#

Hypersim 深度数据集分为两个子集:

  1. 训练集:68,242 张图像,配有对应的稠密深度图,用于训练。
  2. 验证集:6,377 张图像,配有对应的稠密深度图,用于训练期间的验证。

每张 RGB 图像都配有一张经过缩放的 uint16 深度 PNG,遵循 Ultralytics 深度数据集格式。

获取数据#

Hypersim 不支持自动下载——Apple 根据 CC BY-SA 3.0 许可分发数据集(每个场景的 ZIP 文件总计约 ~1.9 TB),你可以使用 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 ./scenes

RGB 帧位于 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 模型的大型多数据集混合数据(约 ~2.19M 张图像)中的一个训练数据源。在该混合数据中,Hypersim 提供干净、稠密的室内几何信息,与噪声更大的真实世界传感器数据互为补充。

此配置中没有单独留出的 Hypersim 基准。相反,最终模型会在标准单目深度基准上进行评估:NYU Depth V2、KITTI、Make3D、ETH3D 和 iBims-1。

数据集 YAML#

数据集配置通过 YAML 文件定义。文件中包含数据集路径、类别及其他相关信息。对于 Hypersim,depth-hypersim.yaml 文件定义了路径和唯一的 depth 类别。

ultralytics/cfg/datasets/depth-hypersim.yaml
# 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

# 加载模型
model = YOLO("yolo26n-depth.pt")  # 加载预训练模型(推荐用于训练)

# 训练模型
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 仓库中的官方脚本获取场景(约 ~1.9 TB),然后将 depth_meters.hdf5 射线距离转换为平面深度,并使用获取数据中的脚本生成以毫米为单位的 PNG。将窗户和天空等位置的 NaN 像素映射为 0,使其被视为无效值。

  • 运行 yolo depth train data=depth-hypersim.yaml model=yolo26n-depth.pt epochs=100 imgsz=640,或使用用法部分中的 Python 示例。训练页面列出了所有可用参数。

评论