File size: 8,206 Bytes
1d15e3f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# 真实洞穴样例端到端说明

本文以当前 `rock` 样例说明从输入到 RGB-D 3D 视频、3DGS 和训练数据的实际过程。

## 0. 样例来源

图片生成分支使用:

```text
/mnt/datadisk0/xj/tunnel_cave_dataset/images/rock/IMG_20261011_135541.jpg
```

WorldMirror-2 分支使用同一数据集中的裸露岩石旋转视频,并等距取 6 帧:

```text
/mnt/datadisk0/xj/tunnel_cave_dataset/baseline/worldmirror_rock_input/
├── 000001.jpg
├── 000013.jpg
├── 000025.jpg
├── 000037.jpg
├── 000049.jpg
└── 000061.jpg
```

每张输入帧为 960×1706 的普通透视图。原始视频是固定点位旋转拍摄,视频本身没有直接提供 ERP 全景。

## 1. Voyager 条件生成

### 调用的模型

```text
MoGeModel.from_pretrained("Ruicheng/moge-vitl")
```

MoGe 对真实洞穴图片估计初始深度。Voyager 数据引擎随后把深度图反投影为点云,再使用内置的 `camera_list` 创建 49 个相机位姿。

### 执行命令

```bash
cd /mnt/datadisk0/xj/HunyuanWorld-Voyager/data_engine
source /mnt/datadisk0/xj/HunyuanWorld-Voyager/.venv/bin/activate

python create_input.py \
  --image_path /mnt/datadisk0/xj/tunnel_cave_dataset/images/rock/IMG_20261011_135541.jpg \
  --render_output_dir /mnt/datadisk0/xj/tunnel_cave_dataset/baseline/voyager_rock_forward \
  --type forward
```

### 内部处理

```text
RGB 图片 1280×720
→ MoGe depth
→ 反投影点云
→ forward 相机轨迹
→ 点云投影和 z-buffer
→ 49 个 RGB 条件帧、深度和 mask
```

当前数据引擎的 forward 轨迹从相机位置 `[0, 0, 0]` 移动到 `[0, 0, 1]`。深度在写入 EXR 前会转换为逆深度,并按 2% 到 98% 分位数归一化。因此这些 EXR 是 Voyager 条件深度,适合生成条件,不能直接视为绝对米制深度真值。

### 输出

```text
/mnt/datadisk0/xj/tunnel_cave_dataset/baseline/voyager_rock_forward/
├── ref_image.png              # 1280×720 RGB
├── ref_depth.exr              # 720×1280×1 float32
├── depth_range.json           # 每帧深度归一化范围
└── video_input/
    ├── render_0000.png ... render_0048.png  # RGB 条件
    ├── depth_0000.exr  ... depth_0048.exr   # float32 条件深度
    └── mask_0000.png   ... mask_0048.png    # 投影有效区域
```

## 2. Voyager RGB-D 视频推理

### 调用的模型

```text
HunyuanWorld-Voyager
权重:Voyager/transformers/mp_rank_00_model_states_context.pt
```

文本编码器、VAE 和 I2V 组件从本地 Voyager checkpoint 目录加载。Context Block 版本需要同时启用 `--use-context-block`。

### 输入

```text
ref_image.png
ref_depth.exr
video_input/render_*.png
video_input/depth_*.exr
video_input/mask_*.png
```

文本 prompt:

```text
underground construction tunnel with exposed rough rock walls, arched tunnel ceiling,
rock bolts and shotcrete marks, broken rock rubble on the floor, dim industrial work
lights, realistic low-light documentary video, stable forward camera motion
```

### 执行命令

```bash
cd /mnt/datadisk0/xj/HunyuanWorld-Voyager
source .venv/bin/activate
export MODEL_BASE=/mnt/datadisk0/xj/HunyuanWorld-Voyager/ckpts

ALLOW_RESIZE_FOR_SP=1 CUDA_VISIBLE_DEVICES=0,1 \
torchrun --nproc_per_node=2 sample_image2video.py \
  --model HYVideo-T/2 \
  --input-path /mnt/datadisk0/xj/tunnel_cave_dataset/baseline/voyager_rock_forward \
  --prompt "underground construction tunnel with exposed rough rock walls, arched tunnel ceiling, rock bolts and shotcrete marks, broken rock rubble on the floor, dim industrial work lights, realistic low-light documentary video, stable forward camera motion" \
  --neg-prompt "equirectangular distortion, fisheye distortion, severe motion blur, flicker, warped geometry, duplicated objects, text, watermark" \
  --i2v-stability \
  --use-context-block \
  --i2v-resolution 540p \
  --model-resolution 540p \
  --video-size 512 768 \
  --video-length 49 \
  --infer-steps 30 \
  --flow-reverse \
  --flow-shift 7.0 \
  --seed 0 \
  --embedded-cfg-scale 6.0 \
  --model-base /mnt/datadisk0/xj/HunyuanWorld-Voyager/ckpts \
  --i2v-dit-weight /mnt/datadisk0/xj/HunyuanWorld-Voyager/ckpts/Voyager/transformers/mp_rank_00_model_states_context.pt \
  --save-path /mnt/datadisk0/xj/tunnel_cave_dataset/baseline/voyager_output_540p \
  --ulysses-degree 2 \
  --ring-degree 1
```

### 输出

```text
/mnt/datadisk0/xj/tunnel_cave_dataset/baseline/voyager_output_540p/*.mp4
```

当前正式结果实际为:

```text
768×1024
24 FPS
45 帧
约 1.875 秒
```

视频上下拼接保存:上半部分为 768×512 RGB,下半部分为 768×512 深度可视化。它是 RGB-D 视频,后续可以使用 Voyager 的点云转换脚本导出点云。

## 3. WorldMirror-2 真实几何恢复

### 调用的模型

```text
HY-World 2.0 / HY-WorldMirror-2.0
checkpoint:/mnt/datadisk0/xj/HY-World-2.0/ckpts/HY-WorldMirror-2.0/model.safetensors
```

WorldMirror-2 当前只使用图像序列。它不读取 Voyager 文本 prompt,文本只在后续训练 manifest 中保存。

### 执行命令

```bash
cd /mnt/datadisk0/xj/HY-World-2.0
source /mnt/datadisk0/xj/HunyuanWorld-Voyager/.venv/bin/activate

CUDA_VISIBLE_DEVICES=1 python -m hyworld2.worldrecon.pipeline \
  --input_path /mnt/datadisk0/xj/tunnel_cave_dataset/baseline/worldmirror_rock_input \
  --strict_output_path /mnt/datadisk0/xj/tunnel_cave_dataset/baseline/worldmirror_output/rock_rendered3 \
  --pretrained_model_name_or_path /mnt/datadisk0/xj/HY-World-2.0/ckpts \
  --subfolder HY-WorldMirror-2.0 \
  --no_sky_mask \
  --save_colmap \
  --save_rendered \
  --render_depth \
  --enable_bf16 \
  --no_interactive
```

### WorldMirror-2 前向输出

单次前向同时产生:

```text
6 个 depth map
6 个 normal map
6 组 camera intrinsics/extrinsics
6 个 point map 视图
3DGS 属性:means、scales、rotations、opacities、SH/colors
```

### 输出目录

```text
/mnt/datadisk0/xj/tunnel_cave_dataset/baseline/worldmirror_output/rock_rendered3/
├── depth/
│   ├── depth_0000.npy ... depth_0005.npy
│   └── depth_0000.png ... depth_0005.png
├── normal/
│   └── normal_0000.png ... normal_0005.png
├── camera_params.json
├── points.ply
├── gaussians.ply
├── sparse/0/
└── rendered/
    ├── rendered_rgb.mp4
    └── rendered_depth.mp4
```

当前浮点深度为 `float32`,首帧数组尺寸为 `(952, 532)`,数值范围约为 `0.30` 到 `3.62`。`camera_params.json` 中包含 6 组 4×4 外参矩阵和 3×3 内参矩阵。

## 4. WorldMirror-2 如何生成 3D 视频

WorldMirror-2 本身先输出 3DGS,不直接生成最终视频。视频来自后处理的 Gaussian Splat Renderer:

```text
gaussians.ply
    + camera_params.json
    ↓
相邻相机位姿插值
    ↓
3D Gaussian 光栅化
    ↓
RGB 帧和深度帧
    ↓
MoviePy 编码
    ↓
rendered_rgb.mp4
rendered_depth.mp4
```

当前渲染视频为:

```text
532×952
30 FPS
80 帧
约 2.67 秒
```

这里的 RGB 视频是由 3DGS 新视角渲染得到的,深度视频是渲染深度的可视化版本。它与 Voyager 的扩散生成视频属于两种不同的生成机制。

## 5. 两条分支如何进入训练

```mermaid
flowchart LR
    A[Voyager RGB-D MP4] --> C[RGB-D 样本拆分]
    B[WorldMirror depth.npy + camera.json + gaussians.ply] --> D[真实几何监督]
    B --> E[3DGS 轨迹渲染]
    E --> C
    C --> F[rgbd_manifest.jsonl]
    D --> F
    F --> G[Voyager LoRA 训练]
```

当前 manifest:

```text
/mnt/datadisk0/xj/tunnel_cave_dataset/baseline/rgbd_samples/rgbd_manifest.jsonl
```

当前生成了 176 条基线记录。Voyager 和渲染深度视频的 PNG 主要用于格式和时序检查。WorldMirror-2 的 `depth_*.npy` 用于几何监督,正式训练还需要从 3DGS 渲染器保存每个轨迹帧的浮点深度。

## 6. 一句话总结

```text
Voyager:图片 + 文本 + 初始深度 + 相机条件 → RGB-D 生成视频

WorldMirror-2:真实视频帧 → 深度 + 相机 + 点云 + 3DGS → 新视角 RGB-D 渲染视频

训练闭环:WorldMirror-2 几何结果 → RGB-D 轨迹数据 → Voyager LoRA
```