☰
如何快速上手InfiniDepth:环境搭建、检查点下载与常见避坑完整指南
2026/10/15 18:47:49 网站建设 项目流程

【免费下载链接】InfiniDepth

[CVPR 2026] InfiniDepth: Arbitrary-Resolution and Fine-Grained Depth Estimation with Neural Implicit Fields

项目地址:https://gitcode.com/gh_mirrors/in/InfiniDepth
点击查看免费下载

InfiniDepth 是一个 CVPR 2026 发布的任意分辨率、细粒度深度估计项目,基于神经隐式场(Neural Implicit Fields)实现,支持从单张 RGB 图像估计深度图、生成 3D Gaussian Splatting 重建,以及结合深度传感器恢复度量深度。本文将带你完整走通 InfiniDepth 环境搭建、依赖安装、检查点下载与目录摆放、第一条推理命令,并汇总新手最常见的避坑要点。

一、先认识 InfiniDepth:三大核心能力

在动手前,先确认它能为你的场景做什么。项目支持以下三种实用能力:

能力输入输出
单目、任意分辨率深度估计RGB 图像任意分辨率深度图
单目视图合成RGB 图像3D Gaussian Splatting(3DGS)
深度传感器增强(单目度量深度)RGB 图像 + 稀疏深度度量深度 + 3DGS

仓库自带多张示例输入图,覆盖庭院、街景、室内静物等典型场景,方便你验证安装是否成功:

示例图说明
example_data/image/courtyard.jpg庭院场景,官方深度推理示例的默认输入
example_data/image/waymo_002.pngWaymo 街景,用于深度传感器与多视角示例
example_data/image/camera.png室内静物,3DGS 合成示例输入之一

二、环境搭建:从零开始的完整步骤

手动安装的完整说明见 INSTALL.md,下面是最短可行路径。

第 1 步:获取代码并创建 Python 环境

git clone https://gitcode.com/gh_mirrors/in/InfiniDepth cd InfiniDepth # 推荐 miniforge + mamba;若用 conda,将 mamba 换成 conda, # 并在安装 gxx 时改用 conda-forge 渠道 mamba create -n infinidepth python=3.10 mamba activate infinidepth

第 2 步:安装 PyTorch 与全部依赖

# 安装包管理器 uv pip install uv # 安装 PyTorch(CUDA 12.8 版本) uv pip install torch==2.9.0 torchvision==0.24.0 torchaudio==2.9.0 xformers==0.0.33.post1 --index-url https://download.pytorch.org/whl/cu128 # 安装项目依赖(见 requirements.txt) uv pip install -r requirements.txt

此外还需安装两个组件,安装命令详见 INSTALL.md:

  • MoGe:用于在缺少深度输入时恢复度量尺度(point cloud / 3DGS 导出必需)
  • gsplat:Gaussian Splatting 渲染核心,3DGS 任务必需

第 3 步:(可选)解决 gsplat 编译失败

如果 gsplat 因 g++ 版本或 CUDA toolkit 问题编译失败,按 INSTALL.md 的提示处理:

mamba install gxx=10 mamba install nvidia/label/cuda-12.8.0::cuda-toolkit -c nvidia/label/cuda-12.8.0 export CUDA_HOME=$CONDA_PREFIX

三、检查点下载与目录摆放(最容易出错的环节)

3.1 模型清单(Model Zoo)

权重统一从官方 Model Zoo 下载(下载地址见 INSTALL.md 中的表格),对应关系如下:

类别模型用途
DepthInfiniDepth相对深度推理(仅 RGB)
DepthInfiniDepth_DepthSensor度量深度推理(RGB + 稀疏深度)
DepthMoGe-2度量尺度恢复(model.pt)
GSInfiniDepth_GS高斯推理(仅 RGB)
GSInfiniDepth_DepthSensor_GS高斯推理(RGB + 稀疏深度)
SkySky_Mask天空分割(skyseg.onnx)

3.2 标准目录结构

下载完成后,请严格按照下面的目录结构摆放(目录名是硬编码的,不要改名):

checkpoints/ ├── depth/ │ ├── infinidepth.ckpt # RGB 相对深度 │ └── infinidepth_depthsensor.ckpt # RGB+深度 度量深度 ├── gs/ │ ├── infinidepth_gs.ckpt │ └── infinidepth_depthsensor_gs.ckpt ├── moge-2-vitl-normal/ │ └── model.pt # 尺度恢复 └── sky/ └── skyseg.onnx # 可选:天空过滤

⚠️只跑"单图相对深度"最小需要 3 个文件:infinidepth.ckpt+moge-2-vitl-normal/model.pt;skyseg.onnx是可选的天空过滤增强。

四、跑通第一条深度推理命令

使用仓库自带示例图 courtyard.jpg,直接运行官方脚本 example_scripts/infer_depth/courtyard_infinidepth.sh:

python inference_depth.py \ --input_image_path=example_data/image/courtyard.jpg \ --model_type=InfiniDepth \ --depth_model_path=checkpoints/depth/infinidepth.ckpt \ --output_resolution_mode=upsample \ --upsample_ratio=2

运行成功后,结果写入输入数据目录旁:

  • example_data/pred_depth/:彩色深度图
  • example_data/pred_pcd/:点云(开启--save_pcd=True时导出)

常用参数速查(详见 inference_depth.py):

参数作用
--output_resolution_modeupsample/original/specific三种输出分辨率模式
--upsample_ratioupsample模式下的放大倍数(任意分辨率的关键)
--output_sizespecific模式下的显式输出尺寸(H,W)
--save_pcd同时导出点云
--fx_org --fy_org --cx_org --cy_org原图分辨率下的相机内参

五、进阶场景命令速查

单图生成 3D Gaussian + 新视角视频

脚本:example_scripts/infer_gs/courtyard_infinidepth_gs.sh

python inference_gs.py \ --input_image_path=example_data/image/courtyard.jpg \ --model_type=InfiniDepth \ --depth_model_path=checkpoints/depth/infinidepth.ckpt \ --gs_model_path=checkpoints/gs/infinidepth_gs.ckpt

输出.ply高斯文件与新视角视频(pred_gs/目录)。

RGB + 深度传感器:度量深度推理

以 ETH3D 示例为例(RGB 与深度文件需配对,深度支持.png、.npy、.npz、.h5、.hdf5、.exr):

python inference_depth.py \ --input_image_path=example_data/image/eth3d_office.png \ --input_depth_path=example_data/depth/eth3d_office.npz \ --model_type=InfiniDepth_DepthSensor \ --depth_model_path=checkpoints/depth/infinidepth_depthsensor.ckpt \ --fx_org=866.39 --fy_org=866.04 --cx_org=791.5 --cy_org=523.81 \ --output_resolution_mode=upsample --upsample_ratio=1

多视角 / 视频深度 + 全局点云

支持图片目录、单图或视频输入,默认可用 DA3 对整个序列做位姿对齐;若已知相机内外参,可直接提供 Waymo 风格文本目录跳过 DA3:

python inference_multi_view_depth.py \ --input_path=example_data/multi-view/waymo/image \ --model_type=InfiniDepth \ --depth_model_path=checkpoints/depth/infinidepth.ckpt

对应脚本:example_scripts/infer_depth/waymo_multi_view_infinidepth.sh,结果输出到pred_sequence/<序列名>/下的深度、点云与元数据子目录。

不想敲命令?用 Gradio 界面

运行python app.py即可启动本地可视化界面(入口 app.py):输入 RGB 图(必填)+ 深度图(可选),任务可在Depth/3DGS间切换,模型可在InfiniDepth/InfiniDepth_DepthSensor间切换。

六、常见避坑清单 ⚠️

  1. gsplat 编译失败:绝大多数是 g++ 或 CUDA toolkit 版本问题,装gxx=10+cuda-toolkit 12.8并export CUDA_HOME=$CONDA_PREFIX即可(见 INSTALL.md)。用 conda 时记得把 gxx 的渠道换成conda-forge。
  2. model_type与检查点必须配对:InfiniDepth→infinidepth.ckpt;InfiniDepth_DepthSensor→infinidepth_depthsensor.ckpt,且必须同时传--input_depth_path。只有 RGB 时请一定用InfiniDepth,否则报缺文件。
  3. 忘记下载 MoGe-2:导出点云 / 3DGS 的度量尺度依赖checkpoints/moge-2-vitl-normal/model.pt,缺了它导出流程会中断。
  4. DepthSensor 模式建议传内参:--fx_org --fy_org --cx_org --cy_org强烈建议提供;缺失时会回退到 MoGe-2 估计或按图像尺寸取默认值,精度受损。
  5. numpy 版本冲突:requirements.txt 固定了numpy<2.0,若环境里是 numpy 2.x 可能报 ABI 错误,装完依赖后请检查版本。
  6. 多视角显式相机模式:--camera_intrinsics_dir与--camera_extrinsics_dir中的 txt 文件按字典序排序后与图片一一对应,文件数量必须与图片数量完全一致;该模式只支持图片输入,不支持视频。
  7. 找不到输出文件:结果不在脚本目录,而是生成在输入数据目录旁的pred_depth/、pred_pcd/、pred_gs/、pred_sequence/中。
  8. Gradio 界面里用 DepthSensor 报错:InfiniDepth_DepthSensor需要上传深度图;只用 RGB 时请切换回InfiniDepth模型。

七、关键文件导航

  • 手动安装指南:INSTALL.md
  • 深度推理入口:inference_depth.py
  • 3DGS 推理入口:inference_gs.py
  • 多视角推理入口:inference_multi_view_depth.py
  • Gradio 可视化入口:app.py
  • 示例脚本目录:example_scripts/
  • 示例数据(图片 / 深度 / 多视角):example_data/
  • 核心网络与渲染模块:InfiniDepth/gs/、InfiniDepth/model/

按本文顺序走完"环境 → 权重 → 命令"三步,并对照避坑清单自查,你就能顺利跑通 InfiniDepth 的任意分辨率深度估计与 3DGS 重建 🚀

【免费下载链接】InfiniDepth

[CVPR 2026] InfiniDepth: Arbitrary-Resolution and Fine-Grained Depth Estimation with Neural Implicit Fields

项目地址:https://gitcode.com/gh_mirrors/in/InfiniDepth
点击查看免费下载

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询