lc700x
/

Depth Estimation
Safetensors
vitb16
lc700x commited on
Commit
118d20f
·
0 Parent(s):

Duplicate from lc700x/InfiniDepth-Large

Browse files
Files changed (2) hide show
  1. .gitattributes +35 -0
  2. README.md +656 -0
.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,656 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - ritianyu/Hypersim
5
+ base_model:
6
+ - ritianyu/InfiniDepth
7
+ pipeline_tag: depth-estimation
8
+ tags:
9
+ - vitl16
10
+ ---
11
+
12
+
13
+ <div align="center">
14
+
15
+ <h1>
16
+ <img src="https://raw.githubusercontent.com/Tarikul-Islam-Anik/Animated-Fluent-Emojis/master/Emojis/Objects/Telescope.png" alt="Telescope" width="40" height="40" />
17
+ InfiniDepth: Arbitrary-Resolution and Fine-Grained Depth Estimation with Neural Implicit Fields
18
+ </h1>
19
+
20
+ <div align="center">
21
+ <a href="https://zju3dv.github.io/InfiniDepth/">
22
+ <img src="https://img.shields.io/badge/Project-Page-red?logo=googlechrome&logoColor=red">
23
+ </a>
24
+ <a href="https://arxiv.org/abs/2601.03252">
25
+ <img src="https://img.shields.io/badge/arXiv-Paper-blue?logo=arxiv&logoColor=blue">
26
+ </a>
27
+ <a href="https://huggingface.co/spaces/ritianyu/InfiniDepth">
28
+ <img src="https://img.shields.io/badge/HuggingFace-Demo-yellow?logo=huggingface&logoColor=yellow">
29
+ </a>
30
+ <a href="https://huggingface.co/datasets/ritianyu/game_4k_data">
31
+ <img src="https://img.shields.io/badge/HuggingFace-Dataset-orange?logo=huggingface&logoColor=orange">
32
+ </a>
33
+ <a href="assets/wechat.jpg">
34
+ <img src="https://img.shields.io/badge/微信-WeChat-green?logo=wechat&logoColor=green">
35
+ </a>
36
+ </div>
37
+
38
+ <p align="center">
39
+ <a href="https://ritianyu.github.io/">Hao Yu*</a> •
40
+ <a href="https://haotongl.github.io/">Haotong Lin*</a> •
41
+ <a href="https://github.com/PLUS-WAVE">Jiawei Wang*</a> •
42
+ <a href="https://github.com/Dustbin-Li">Jiaxin Li</a> •
43
+ <a href="https://wangyida.github.io/">Yida Wang</a> •
44
+ <a href="#">Xueyang Zhang</a> •
45
+ <a href="https://ywang-zju.github.io/">Yue Wang</a> <br>
46
+ <a href="https://www.xzhou.me/">Xiaowei Zhou</a> •
47
+ <a href="https://csse.szu.edu.cn/staff/ruizhenhu/">Ruizhen Hu</a> •
48
+ <a href="https://pengsida.net/">Sida Peng</a>
49
+ </p>
50
+
51
+ </div>
52
+
53
+ <div align="center">
54
+
55
+ <!-- <img src="assets/demo.gif" alt="InfiniDepth Demo" width="90%" /> -->
56
+
57
+ </div>
58
+
59
+ ## 📢 News
60
+ > **[2026-04]** 🎉 Training and evaluation code of InfiniDepth (RGB Only & Depth Sensor Augmentation) is available now!
61
+
62
+ > **[2026-03]** 🎉 Inference code of InfiniDepth (RGB Only & Depth Sensor Augmentation) is available now!
63
+
64
+ > **[2026-02]** 🎉 InfiniDepth has been accepted to CVPR 2026! Code coming soon!
65
+
66
+
67
+ ## ✨ What can InfiniDepth do?
68
+ InfiniDepth supports three practical capabilities for single-image 3D perception and reconstruction:
69
+
70
+ | Capability | Input | Output |
71
+ | --- | --- | --- |
72
+ | Monocular & Arbitrary-Resolution Depth Estimation | RGB Image | Arbitrary-Resolution Depth Map |
73
+ | Monocular View Synthesis | RGB Image | 3D Gaussian Splatting (3DGS) |
74
+ | Depth Sensor Augmentation (Monocular Metric Depth Estimation) | RGB Image + Depth Sensor | Metric Depth + 3D Gaussian Splatting (3DGS) |
75
+
76
+ ## ⚙️ Installation
77
+
78
+ Please see [INSTALL.md](INSTALL.md) for manual installation.
79
+
80
+ ## 🤗 Hugging Face Space Demo
81
+
82
+ If you want to test InfiniDepth before running local CLI inference, start with the hosted demo:
83
+
84
+ - Hugging Face Space: https://huggingface.co/spaces/ritianyu/InfiniDepth
85
+
86
+ This repo also includes a Gradio Space entrypoint at `app.py`:
87
+
88
+ - Input: RGB image (required), depth map (optional)
89
+ - Task Switch: `Depth` / `3DGS`
90
+ - Model Switch: `InfiniDepth` / `InfiniDepth_DepthSensor`
91
+
92
+ ### Local run
93
+
94
+ ```bash
95
+ python app.py
96
+ ```
97
+
98
+ ### Notes
99
+
100
+ - In this demo, `InfiniDepth_DepthSensor` requires a depth map input; RGB-only inference should use `InfiniDepth`.
101
+ - Supported depth formats in the demo upload: `.png`, `.npy`, `.npz`, `.h5`, `.hdf5`, `.exr`.
102
+
103
+
104
+ ## 🚀 Inference
105
+
106
+ ### Quick Command Index
107
+
108
+ | If you want ... | Recommended command |
109
+ | --- | --- |
110
+ | Relative Depth from Single RGB Image | `bash example_scripts/infer_depth/courtyard_infinidepth.sh` |
111
+ | 3D Gaussian from Single RGB Image | `bash example_scripts/infer_gs/courtyard_infinidepth_gs.sh` |
112
+ | Metric Depth from RGB + Depth Sensor | `bash example_scripts/infer_depth/eth3d_infinidepth_depthsensor.sh` |
113
+ | 3D Gaussian from RGB + Depth Sensor | `bash example_scripts/infer_gs/eth3d_infinidepth_depthsensor_gs.sh` |
114
+ | Multi-View / Video Depth + Global Point Cloud | `bash example_scripts/infer_depth/waymo_multi_view_infinidepth.sh` |
115
+
116
+ <details>
117
+ <summary><strong> 1. Relative Depth from Single RGB Image</strong> (<code>inference_depth.py</code>)</summary>
118
+
119
+ Use this when you want a relative depth map from a single RGB image and, optionally, a point cloud export.
120
+
121
+ **Required input**
122
+
123
+ - `RGB image`
124
+
125
+ **Required checkpoints**
126
+
127
+ - `checkpoints/depth/infinidepth.ckpt`
128
+ - `checkpoints/moge-2-vitl-normal/model.pt` recover metric scale for point cloud export
129
+
130
+ **Optional checkpoint**
131
+
132
+ - `checkpoints/sky/skyseg.onnx` additional sky filtering
133
+
134
+ **Recommended command**
135
+
136
+ ```bash
137
+ python inference_depth.py \
138
+ --input_image_path=example_data/image/courtyard.jpg \
139
+ --model_type=InfiniDepth \
140
+ --depth_model_path=checkpoints/depth/infinidepth.ckpt \
141
+ --output_resolution_mode=upsample \
142
+ --upsample_ratio=2
143
+ ```
144
+
145
+ Replace `example_data/image/courtyard.jpg` with your own image path.
146
+
147
+ **For the example above, outputs are written to**
148
+
149
+ - `example_data/pred_depth/` for the colorized depth map
150
+ - `example_data/pred_pcd/` for the exported point cloud when `--save_pcd=True`
151
+
152
+ **Example scripts**
153
+
154
+ ```bash
155
+ bash example_scripts/infer_depth/courtyard_infinidepth.sh
156
+ bash example_scripts/infer_depth/camera_infinidepth.sh
157
+ bash example_scripts/infer_depth/eth3d_infinidepth.sh
158
+ bash example_scripts/infer_depth/waymo_infinidepth.sh
159
+ ```
160
+
161
+ **Most useful options**
162
+
163
+ | Argument | What it controls |
164
+ | --- | --- |
165
+ | `--output_resolution_mode` | Choose `upsample`, `original`, or `specific`. |
166
+ | `--upsample_ratio` | Used when `output_resolution_mode=upsample`. |
167
+ | `--output_size` | Explicit output size `(H,W)` when `output_resolution_mode=specific`. |
168
+ | `--save_pcd` | Export a point cloud alongside the depth map. |
169
+ | `--fx_org --fy_org --cx_org --cy_org` | Camera intrinsics in the original image resolution. |
170
+
171
+ </details>
172
+
173
+ <details>
174
+ <summary><strong>2. 3D Gaussian + Novel-View Video from Single RGB Image</strong> (<code>inference_gs.py</code>)</summary>
175
+
176
+ Use this when you want a 3D Gaussian export from a single RGB image and an optional novel-view video.
177
+
178
+ **Required input**
179
+
180
+ - `RGB image`
181
+
182
+ **Required checkpoints**
183
+
184
+ - `checkpoints/depth/infinidepth.ckpt`
185
+ - `checkpoints/gs/infinidepth_gs.ckpt`
186
+ - `checkpoints/moge-2-vitl-normal/model.pt` recover metric scale for 3D Gaussian export
187
+
188
+ **Optional checkpoint**
189
+
190
+ - `checkpoints/sky/skyseg.onnx` additional sky filtering
191
+
192
+ **Recommended command**
193
+
194
+ ```bash
195
+ python inference_gs.py \
196
+ --input_image_path=example_data/image/courtyard.jpg \
197
+ --model_type=InfiniDepth \
198
+ --depth_model_path=checkpoints/depth/infinidepth.ckpt \
199
+ --gs_model_path=checkpoints/gs/infinidepth_gs.ckpt
200
+ ```
201
+
202
+ Replace `example_data/image/courtyard.jpg` with your own image path.
203
+
204
+ **For the example above, outputs are written to**
205
+
206
+ - `example_data/pred_gs/InfiniDepth_courtyard_gaussians.ply`
207
+ - `example_data/pred_gs/InfiniDepth_courtyard_novel_orbit.mp4`
208
+
209
+ If `--render_size` is omitted, the novel-view video is rendered at the original input image resolution.
210
+
211
+ **Example scripts**
212
+
213
+ ```bash
214
+ bash example_scripts/infer_gs/courtyard_infinidepth_gs.sh
215
+ bash example_scripts/infer_gs/camera_infinidepth_gs.sh
216
+ bash example_scripts/infer_gs/fruit_infinidepth_gs.sh
217
+ bash example_scripts/infer_gs/eth3d_infinidepth_gs.sh
218
+ ```
219
+
220
+ **Most useful options**
221
+
222
+ | Argument | What it controls |
223
+ | --- | --- |
224
+ | `--render_novel_video` | Turn novel-view rendering on or off. |
225
+ | `--render_size` | Output video resolution `(H,W)`. |
226
+ | `--novel_trajectory` | Camera motion type: `orbit` or `swing`. |
227
+ | `--sample_point_num` | Number of sampled points used for gaussian construction. |
228
+ | `--enable_skyseg_model` | Enable sky masking before gaussian sampling. |
229
+ | `--sample_sky_mask_dilate_px` | Dilate the sky mask before filtering. |
230
+
231
+ > The exported `.ply` files can be visualized in 3D viewers such as [SuperSplat](https://superspl.at/).
232
+
233
+ </details>
234
+
235
+ <details>
236
+ <summary><strong>3. Depth Sensor Augmentation (Metric Depth and 3D Gaussian from RGB + Depth Sensor)</strong></summary>
237
+
238
+ Use this mode when you have an RGB image plus metric depth from a depth sensor.
239
+
240
+ **Required inputs**
241
+
242
+ - `RGB image`
243
+ - `Sparse depth` in `.png`, `.npy`, `.npz`, `.h5`, `.hdf5`, or `.exr`
244
+
245
+ **Required checkpoints**
246
+
247
+ - `checkpoints/depth/infinidepth_depthsensor.ckpt`
248
+ - `checkpoints/moge-2-vitl-normal/model.pt`
249
+ - `checkpoints/gs/infinidepth_depthsensor_gs.ckpt`
250
+
251
+ **Required flags**
252
+
253
+ - `--model_type=InfiniDepth_DepthSensor`
254
+ - `--input_depth_path=...`
255
+
256
+
257
+ **Metric Depth Inference Command**
258
+
259
+ ```bash
260
+ python inference_depth.py \
261
+ --input_image_path=example_data/image/eth3d_office.png \
262
+ --input_depth_path=example_data/depth/eth3d_office.npz \
263
+ --model_type=InfiniDepth_DepthSensor \
264
+ --depth_model_path=checkpoints/depth/infinidepth_depthsensor.ckpt \
265
+ --fx_org=866.39 \
266
+ --fy_org=866.04 \
267
+ --cx_org=791.5 \
268
+ --cy_org=523.81 \
269
+ --output_resolution_mode=upsample \
270
+ --upsample_ratio=1
271
+ ```
272
+
273
+ **3D Gaussian Inference Command**
274
+
275
+ ```bash
276
+ python inference_gs.py \
277
+ --input_image_path=example_data/image/eth3d_office.png \
278
+ --input_depth_path=example_data/depth/eth3d_office.npz \
279
+ --model_type=InfiniDepth_DepthSensor \
280
+ --depth_model_path=checkpoints/depth/infinidepth_depthsensor.ckpt \
281
+ --gs_model_path=checkpoints/gs/infinidepth_depthsensor_gs.ckpt \
282
+ --fx_org=866.39 \
283
+ --fy_org=866.04 \
284
+ --cx_org=791.5 \
285
+ --cy_org=523.81
286
+ ```
287
+
288
+ **Example scripts**
289
+
290
+ ```bash
291
+ bash example_scripts/infer_depth/eth3d_infinidepth_depthsensor.sh
292
+ bash example_scripts/infer_depth/waymo_infinidepth_depthsensor.sh
293
+ bash example_scripts/infer_gs/eth3d_infinidepth_depthsensor_gs.sh
294
+ bash example_scripts/infer_gs/waymo_infinidepth_depthsensor_gs.sh
295
+ ```
296
+
297
+ **Most useful options**
298
+
299
+ | Argument | What it controls |
300
+ | --- | --- |
301
+ | `--fx_org --fy_org --cx_org --cy_org` | Strongly recommended when you know the sensor intrinsics. |
302
+ | `--output_resolution_mode` | Output behavior for `inference_depth.py`. |
303
+ | `--render_size` | Video resolution for `inference_gs.py`. |
304
+ | `--output_ply_dir` | Custom output directory for gaussian export. |
305
+
306
+ </details>
307
+
308
+ <details>
309
+ <summary><strong>4. Multi-View / Video Depth + Global Point Cloud</strong> (<code>inference_multi_view_depth.py</code>)</summary>
310
+
311
+ Use this when you want sequence-level depth inference from an RGB image folder or video, plus per-frame aligned point clouds and one merged global point cloud. By default the script runs DA3 once on the whole sequence, then aligns each InfiniDepth depth map to the corresponding DA3 depth map before export. When you already know the camera intrinsics and extrinsics, you can instead provide them directly and skip DA3 entirely.
312
+
313
+ **Required inputs**
314
+
315
+ - `RGB image directory`, `single RGB image`, or `video`
316
+ - `Sparse depth` directory / single file / depth video when `--model_type=InfiniDepth_DepthSensor`
317
+
318
+ **Required checkpoints / dependencies**
319
+
320
+ - `checkpoints/depth/infinidepth.ckpt` for RGB-only inference
321
+ - `checkpoints/depth/infinidepth_depthsensor.ckpt` for RGB + depth sensor inference
322
+ - `checkpoints/moge-2-vitl-normal/model.pt` recover metric scale for RGB-only frame inference
323
+ - `depth-anything-3` installed in the current environment when using the default DA3-based sequence mode; default DA3 model is `depth-anything/DA3-LARGE-1.1`
324
+
325
+ **Optional checkpoint**
326
+
327
+ - `checkpoints/sky/skyseg.onnx` additional sky filtering
328
+
329
+ **RGB-Only Multi-View / Video Command**
330
+
331
+ ```bash
332
+ python inference_multi_view_depth.py \
333
+ --input_path=example_data/multi-view/waymo/image \
334
+ --model_type=InfiniDepth \
335
+ --depth_model_path=checkpoints/depth/infinidepth.ckpt \
336
+ ```
337
+
338
+ **RGB + Depth Sensor Multi-View / Video Command**
339
+
340
+ ```bash
341
+ python inference_multi_view_depth.py \
342
+ --input_path=example_data/multi-view/waymo/image \
343
+ --input_depth_path=example_data/multi-view/waymo/depth \
344
+ --model_type=InfiniDepth_DepthSensor \
345
+ --depth_model_path=checkpoints/depth/infinidepth_depthsensor.ckpt \
346
+ ```
347
+
348
+ For video input, replace `--input_path` with a video file. When `--model_type=InfiniDepth_DepthSensor`, `--input_depth_path` can also be a depth video and must contain the same number of frames as the RGB input.
349
+
350
+ **Explicit Camera-Parameter Multi-View Command**
351
+
352
+ ```bash
353
+ python inference_multi_view_depth.py \
354
+ --input_path=example_data/multi-view/waymo/image \
355
+ --camera_intrinsics_dir=/path/to/intrinsics \
356
+ --camera_extrinsics_dir=/path/to/extrinsics \
357
+ --model_type=InfiniDepth \
358
+ --depth_model_path=checkpoints/depth/infinidepth.ckpt \
359
+ ```
360
+
361
+ The explicit camera mode expects Waymo-style text files under `intrinsics/` and `extrinsics/`. Files are sorted lexicographically and matched one-to-one against the sorted RGB image list, so the number of camera files must exactly match the number of images. In this mode the script skips DA3 loading, DA3 cache export, DA3 RANSAC conditioning, and DA3 post scale alignment. This mode currently supports image inputs only, not video.
362
+
363
+ **For the RGB-only example above, outputs are written to**
364
+
365
+ - `example_data/multi-view/waymo/pred_sequence/image/frames/depth/` for aligned raw depth maps
366
+ - `example_data/multi-view/waymo/pred_sequence/image/frames/depth_vis/` for colorized depth maps
367
+ - `example_data/multi-view/waymo/pred_sequence/image/frames/pcd/` for per-frame aligned point clouds
368
+ - `example_data/multi-view/waymo/pred_sequence/image/frames/meta/` for per-frame camera and alignment metadata
369
+ - `example_data/multi-view/waymo/pred_sequence/image/da3/sequence_pose.npz` for cached DA3 predictions
370
+ - `example_data/multi-view/waymo/pred_sequence/image/merged/sequence_merged.ply` for the merged global point cloud
371
+
372
+ **Example scripts**
373
+
374
+ ```bash
375
+ bash example_scripts/infer_depth/waymo_multi_view_infinidepth.sh
376
+ bash example_scripts/infer_depth/waymo_multi_view_infinidepth_depthsensor.sh
377
+ bash example_scripts/infer_depth/waymo_multi_view_infinidepth_explicit_camera.sh
378
+ ```
379
+
380
+ **Most useful options**
381
+
382
+ | Argument | What it controls |
383
+ | --- | --- |
384
+ | `--input_path` | RGB image directory, single image, or video path. |
385
+ | `--input_depth_path` | Depth directory, single depth file, or depth video; required for `InfiniDepth_DepthSensor`. |
386
+ | `--camera_intrinsics_dir --camera_extrinsics_dir` | Enable explicit camera mode from sorted Waymo-style txt directories. Image inputs only; file counts must match the RGB frame count. |
387
+ | `--input_mode` | Force `images` or `video` instead of auto detection. |
388
+ | `--align_to_da3_depth` | Align each InfiniDepth depth map to the corresponding DA3 depth map before export. Ignored in explicit camera mode. |
389
+ | `--save_frame_pcd` | Save one aligned point cloud per frame. |
390
+ | `--save_merged_pcd` | Save the merged global point cloud across the whole sequence. |
391
+ | `--da3_scale_align_conf_threshold` | Minimum DA3 confidence used during per-frame scale estimation. |
392
+ | `--output_root` | Override the default `pred_sequence/<sequence_name>/` output directory. |
393
+
394
+ </details>
395
+
396
+ <details>
397
+ <summary><strong>5. Common Argument Conventions</strong></summary>
398
+
399
+ | Argument | Used in | Description |
400
+ | --- | --- | --- |
401
+ | `--input_image_path` | depth + gs | Path to the input RGB image. |
402
+ | `--input_path` | multi-view | Path to an RGB image directory, single image, or video. |
403
+ | `--input_depth_path` | depth + gs + multi-view | Optional metric depth prompt; required for `InfiniDepth_DepthSensor`. In multi-view mode this can be a depth directory, single depth file, or depth video. |
404
+ | `--camera_intrinsics_dir --camera_extrinsics_dir` | multi-view | Optional sequence camera parameter directories. When both are set, multi-view inference skips DA3 and uses the provided sorted txt files directly. |
405
+ | `--model_type` | depth + gs + multi-view | `InfiniDepth` for RGB-only, `InfiniDepth_DepthSensor` for RGB + sparse depth. |
406
+ | `--depth_model_path` | depth + gs | Path to the depth checkpoint. |
407
+ | `--gs_model_path` | gs only | Path to the gaussian predictor checkpoint. |
408
+ | `--moge2_pretrained` | depth + gs | MoGe-2 checkpoint used when `--input_depth_path` is missing. |
409
+ | `--fx_org --fy_org --cx_org --cy_org` | depth + gs | Camera intrinsics in original image resolution. Missing values fall back to MoGe-2 estimates or image-size defaults. |
410
+ | `--input_size` | depth + gs | Network input size `(H,W)` used during inference. |
411
+ | `--enable_skyseg_model` | depth + gs + multi-view | Enable sky masking before depth or gaussian sampling. |
412
+ | `--sky_model_ckpt_path` | depth + gs | Path to the sky segmentation ONNX checkpoint. |
413
+
414
+ **Depth output modes**
415
+
416
+ - `--output_resolution_mode=upsample`: output size = `input_size * upsample_ratio`
417
+ - `--output_resolution_mode=original`: output size = original input image size
418
+ - `--output_resolution_mode=specific`: output size = `output_size`
419
+
420
+ **Default output directories**
421
+
422
+ | Script | Default directory |
423
+ | --- | --- |
424
+ | `inference_depth.py` depth images | `pred_depth/` next to your input data folder |
425
+ | `inference_depth.py` point clouds | `pred_pcd/` next to your input data folder |
426
+ | `inference_gs.py` gaussians and videos | `pred_gs/` next to your input data folder |
427
+ | `inference_multi_view_depth.py` sequence outputs | `pred_sequence/<sequence_name>/` next to your input data folder |
428
+
429
+ </details>
430
+
431
+ ## 🏋️ Training and Validation
432
+
433
+ The repo also provides `main.py` training and validation entrypoints for InfiniDepth and InfiniDepth_DepthSensor.
434
+
435
+ First, prepare the training/validation data and the pretrained weight as described in [DATA.md](DATA.md).
436
+
437
+ Before running any command, export the environment variables required by `main.py`:
438
+
439
+ ```bash
440
+ export workspace=/path/to/your/experiments
441
+ export commonspace=/path/to/your/common_space
442
+ ```
443
+
444
+ - `workspace` stores experiment outputs under `outputs/<task>/<exp_name>/`
445
+ - `commonspace` stores datasets and pretrained weights shared across experiments
446
+
447
+
448
+ ### Quick Command Index
449
+
450
+ | If you want ... | Recommended command |
451
+ | --- | --- |
452
+ | Fine-tune from an existing checkpoint | Add `ckpt_path=...` to the training command |
453
+ | Train from scratch | Omit `ckpt_path` and use a fresh `exp_name` |
454
+ | Validate on the mixed real-data benchmark | Run `main.py` with `--entry val` |
455
+
456
+ <details>
457
+ <summary><strong>1. Fine-Tuning from an Existing Checkpoint</strong> (<code>main.py</code>, default <code>train_net</code> entry)</summary>
458
+
459
+ Use this when you want to initialize training from an existing InfiniDepth checkpoint. The training config referenced below uses Hypersim as the training set and runs validation on a mixed real-data benchmark at the end of each epoch.
460
+
461
+ **Required environment**
462
+
463
+ - `workspace=/path/to/your/experiments`
464
+ - `commonspace=/path/to/your/common_space`
465
+
466
+ **RGB-Only Fine-Tuning Command**
467
+
468
+ ```bash
469
+ python3 main.py \
470
+ --cfg_file training/exp_configs/exps/infinidepth.yaml \
471
+ --include training/exp_configs/components/data/train/infinidepth_train_hypersim.yaml \
472
+ ckpt_path=checkpoints/depth/infinidepth.ckpt \
473
+ exp_name=finetune_infinidepth_on_hypersim \
474
+ model.compute_abs_metric=True \
475
+ model.save_orig_pred=True \
476
+ model.save_metrics=True \
477
+ pl_trainer.devices=8
478
+ ```
479
+
480
+ **RGB + Depth Sensor Fine-Tuning Command**
481
+
482
+ ```bash
483
+ python3 main.py \
484
+ --cfg_file training/exp_configs/exps/infinidepth_depthsensor.yaml \
485
+ --include training/exp_configs/components/data/train/infinidepth_train_hypersim.yaml \
486
+ ckpt_path=checkpoints/depth/infinidepth_depthsensor.ckpt \
487
+ exp_name=finetune_infinidepth_depthsensor_on_hypersim \
488
+ model.compute_abs_metric=True \
489
+ model.save_orig_pred=True \
490
+ model.save_metrics=True \
491
+ pl_trainer.devices=8
492
+ ```
493
+
494
+ **Equivalent launch scripts**
495
+
496
+ ```bash
497
+ bash launch_scripts/train/infinidepth.sh
498
+ bash launch_scripts/train/infinidepth_depthsensor.sh
499
+ ```
500
+
501
+ **Outputs**
502
+
503
+ - `${workspace}/outputs/${task}/${exp_name}/checkpoints/` for saved checkpoints
504
+ - `${workspace}/outputs/${task}/${exp_name}/tb/` for TensorBoard logs
505
+
506
+ **Notes**
507
+
508
+ - `ckpt_path` must point to an existing checkpoint.
509
+ - The training data config is `training/exp_configs/components/data/train/infinidepth_train_hypersim.yaml`.
510
+ - If the same `exp_name` already has checkpoints in `${workspace}/outputs/${task}/${exp_name}/checkpoints/`, training will resume from the latest saved checkpoint in that directory.
511
+
512
+ </details>
513
+
514
+ <details>
515
+ <summary><strong>2. Train from Scratch</strong> (<code>main.py</code>, no <code>ckpt_path</code>)</summary>
516
+
517
+ Use this when you want to start training without loading an InfiniDepth `.ckpt`. In this mode, do not pass `ckpt_path`. The model will still load the DINOv3 backbone from `${commonspace}/pretrained_models/dinov3/`. You need to download the DINOv3 weights yourself and place them there before running.
518
+
519
+ **RGB-Only Training-from-Scratch Command**
520
+
521
+ ```bash
522
+ python3 main.py \
523
+ --cfg_file training/exp_configs/exps/infinidepth.yaml \
524
+ --include training/exp_configs/components/data/train/infinidepth_train_hypersim.yaml \
525
+ exp_name=train_infinidepth_from_scratch \
526
+ model.compute_abs_metric=True \
527
+ model.save_orig_pred=True \
528
+ model.save_metrics=True \
529
+ pl_trainer.devices=2
530
+ ```
531
+
532
+ **RGB + Depth Sensor Training-from-Scratch Command**
533
+
534
+ ```bash
535
+ python3 main.py \
536
+ --cfg_file training/exp_configs/exps/infinidepth_depthsensor.yaml \
537
+ --include training/exp_configs/components/data/train/infinidepth_train_hypersim.yaml \
538
+ exp_name=train_infinidepth_depthsensor_from_scratch \
539
+ model.compute_abs_metric=True \
540
+ model.save_orig_pred=True \
541
+ model.save_metrics=True \
542
+ pl_trainer.devices=2
543
+ ```
544
+
545
+ **Notes**
546
+
547
+ - Use a new `exp_name` for a clean scratch run.
548
+ - If you intentionally want to reuse an old `exp_name`, set `resume_training=False` to prevent automatic resume. Be careful: when `resume_training=False`, the code will delete the old output directory before training.
549
+
550
+ </details>
551
+
552
+ <details>
553
+ <summary><strong>3. Validation from a Checkpoint</strong> (<code>main.py</code> with <code>--entry val</code>)</summary>
554
+
555
+ Use this when you want to run validation metrics on the mixed real-data benchmark defined in `training/exp_configs/components/data/test/infinidepth_mix_data.yaml`.
556
+
557
+ **RGB-Only Validation Command**
558
+
559
+ ```bash
560
+ python3 main.py \
561
+ --cfg_file training/exp_configs/exps/infinidepth.yaml \
562
+ --include training/exp_configs/components/data/test/infinidepth_mix_data.yaml \
563
+ --entry val \
564
+ ckpt_path=checkpoints/depth/infinidepth.ckpt \
565
+ exp_name=eval_infinidepth \
566
+ model.compute_abs_metric=True \
567
+ model.save_orig_pred=True \
568
+ model.save_metrics=True \
569
+ pl_trainer.devices=2
570
+ ```
571
+
572
+ **RGB + Depth Sensor Validation Command**
573
+
574
+ ```bash
575
+ python3 main.py \
576
+ --cfg_file training/exp_configs/exps/infinidepth_depthsensor.yaml \
577
+ --include training/exp_configs/components/data/test/infinidepth_mix_data.yaml \
578
+ --entry val \
579
+ ckpt_path=checkpoints/depth/infinidepth_depthsensor.ckpt \
580
+ exp_name=eval_infinidepth_depthsensor \
581
+ model.compute_abs_metric=True \
582
+ model.save_orig_pred=True \
583
+ model.save_metrics=True \
584
+ pl_trainer.devices=2
585
+ ```
586
+
587
+ **Reference launch scripts**
588
+
589
+ ```bash
590
+ bash launch_scripts/eval/infinidepth.sh
591
+ bash launch_scripts/eval/infinidepth_depthsensor.sh
592
+ ```
593
+
594
+ **Validation datasets**
595
+
596
+ - Kitti val split
597
+ - ETH3D val split
598
+ - NYU val split
599
+ - ScanNet val split
600
+ - DIODE indoor val split
601
+ - Synth4K (CyberPunk, DeadIsland, SpiderMan2, SpiderManMM, WatchDogLegion)
602
+
603
+ These datasets are read from `${commonspace}/datasets/` using the meta files referenced in `training/exp_configs/components/data/test/infinidepth_mix_data.yaml`.
604
+
605
+ **Outputs**
606
+
607
+ - `${workspace}/outputs/${task}/${exp_name}/val_metrics/` for validation logs
608
+ - `${workspace}/outputs/${task}/${exp_name}/default/metrics/metrics.json` for aggregated validation metrics
609
+ - `${workspace}/outputs/${task}/${exp_name}/default/metrics/all_scenes.csv` when `model.save_metrics=True`
610
+
611
+ </details>
612
+
613
+ <details>
614
+ <summary><strong>4. Common Overrides</strong></summary>
615
+
616
+ | Argument | What it controls |
617
+ | --- | --- |
618
+ | `ckpt_path` | Initialization or evaluation checkpoint path. Omit it for training from scratch. |
619
+ | `exp_name` | Experiment name used to build `${workspace}/outputs/${task}/${exp_name}`. |
620
+ | `pl_trainer.devices` | Number of GPUs used by PyTorch Lightning. |
621
+ | `model.compute_abs_metric` | Enable absolute-metric evaluation during training or validation. |
622
+ | `model.save_orig_pred` | Save original prediction outputs alongside logs and metrics. |
623
+ | `model.save_metrics` | Save metric files for later inspection. |
624
+ | `--entry val` | Switch `main.py` from the default training entry to the validation entry. |
625
+ | `--include` | Merge an extra data config, such as `training/exp_configs/components/data/test/infinidepth_mix_data.yaml`. |
626
+
627
+ </details>
628
+
629
+ ## 🙏 Acknowledgments
630
+
631
+ We thank <a href="https://yuanhongyu.xyz/" target="_blank">Yuanhong Yu</a>, <a href="https://gangweix.github.io/" target="_blank">Gangwei Xu</a>, <a href="https://github.com/ghy0324" target="_blank">Haoyu Guo</a> and <a href="https://hugoycj.github.io/" target="_blank">Chongjie Ye</a> for their insightful discussions and valuable suggestions, and <a href="https://zhenx.me/" target="_blank">Zhen Xu</a> for his dedicated efforts in curating the synthetic data.
632
+
633
+
634
+ ## 📖 Citation
635
+
636
+ If you find InfiniDepth useful in your research, please consider citing:
637
+
638
+ ```bibtex
639
+ @article{yu2026infinidepth,
640
+ title={InfiniDepth: Arbitrary-Resolution and Fine-Grained Depth Estimation with Neural Implicit Fields},
641
+ author={Hao Yu, Haotong Lin, Jiawei Wang, Jiaxin Li, Yida Wang, Xueyang Zhang, Yue Wang, Xiaowei Zhou, Ruizhen Hu and Sida Peng},
642
+ booktitle={arXiv preprint},
643
+ year={2026}
644
+ }
645
+ ```
646
+ ---
647
+
648
+ <div align="center">
649
+
650
+ <img src="https://raw.githubusercontent.com/Tarikul-Islam-Anik/Animated-Fluent-Emojis/master/Emojis/Hand%20gestures/Folded%20Hands%20Light%20Skin%20Tone.png" alt="Thanks" width="25" height="25" />
651
+
652
+ **Thank you for your interest in InfiniDepth!**
653
+
654
+ <sub>⭐ Star this repo if you find it interesting!</sub>
655
+
656
+ </div>