Insta360-Research commited on
Commit
4c97882
Β·
verified Β·
1 Parent(s): ea90acc

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +397 -0
README.md ADDED
@@ -0,0 +1,397 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+
4
+ <div align="center" style="margin-top: 0px; margin-bottom: 0px;">
5
+ <h1>
6
+ <img src="assets/helicopter.png" width="64" alt="PanoWorld logo" style="vertical-align: middle; margin-right: 12px;">
7
+ PanoWorld: Real-World Panoramic Generation
8
+ </h1>
9
+
10
+ <p align="center">
11
+ <a href="https://lihaoy-ux.github.io/panoworld-page/"><img src="https://img.shields.io/badge/Project-Page-green" alt="Project Page"></a>
12
+ <a href="https://arxiv.org/pdf/2607.08765v1"><img src="https://img.shields.io/badge/arXiv-Paper-red?logo=arxiv" alt="arXiv"></a>
13
+ <a href="#"><img src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Model (coming soon)-blue" alt="Hugging Face"></a>
14
+ <a href="#"><img src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Demo (coming soon)-yellow" alt="Demo"></a>
15
+ </p>
16
+
17
+ ![teaser](assets/panoworld_teaser.png)
18
+
19
+
20
+
21
+ </div>
22
+
23
+ OmniRoam Teaser
24
+
25
+ > **Quick try:** demo assets in [`assets/demo/`](assets/demo/) β€” see [Inference](#inference) below.
26
+
27
+
28
+ ## Updates
29
+
30
+ - **[2026-07]** πŸŽ‰ Initial release of code
31
+
32
+ ## Introduction
33
+
34
+ In this work, we aim to address the challenge of long-range memory in panoramic world models by exploiting the rotation-equivariant property of omnidirectional representations, where rotation can be treated as an implicit geometric transformation.
35
+
36
+ Building on this insight, we propose **PanoWorld**, which simplifies camera trajectories into translations via fixed headings for both current-action modeling and long-range memory through **Dense Panoramic Ray-Conditioning (DPRC)** and **Geometry-aware Memory Augmentation (GMA)**. Then, a three-stage training pipeline is introduced to progressively optimize each component.
37
+
38
+ To better evaluate physical consistency under large-scale spatial variations and diverse illumination conditions, where existing datasets are relatively stable, we construct **World360**, a large-scale dataset consisting of both real-world video clips collected via panoramic unmanned aerial vehicles and high-quality simulated clips generated by **AirSim360**.
39
+
40
+ ## Environment Setup
41
+
42
+ ### Prerequisites
43
+
44
+ - **OS**: Linux (tested on Ubuntu 22.04)
45
+ - **GPU**: CUDA-compatible GPU with β‰₯20GB VRAM
46
+ - **CUDA**: 12.8 or higher
47
+ - **Python**: 3.10
48
+ - **FFmpeg**: For video processing
49
+
50
+ ### Step 1: Create Conda Environment
51
+
52
+ Action Model inference uses the **`PanoWorld`** conda env (see [`inference_action.sh`](inference_action.sh)).
53
+
54
+ ```bash
55
+ git clone https://github.com/Insta360-Research-Team/PanoWorld.git
56
+ cd PanoWorld
57
+
58
+ bash scripts/setup_panoworld_env.sh
59
+ conda activate PanoWorld
60
+ ```
61
+
62
+ Or install manually:
63
+
64
+ ```bash
65
+ conda create -n PanoWorld python=3.10 -y
66
+ conda activate PanoWorld
67
+ pip install -e .
68
+ export PYTHONPATH="$(pwd)${PYTHONPATH:+:${PYTHONPATH}}"
69
+ ```
70
+
71
+ Dependencies are listed in [`requirements.txt`](requirements.txt). After Step 1, continue with **Step 2–3** (base model + PanoWorld checkpoints) before running [`inference_action.sh`](inference_action.sh).
72
+
73
+ ### Step 2: Download Base Model (Wan2.2-TI2V-5B)
74
+
75
+ PanoWorld is built upon the [Wan-AI Wan2.2-TI2V-5B](https://huggingface.co/Wan-AI/Wan2.2-TI2V-5B) video diffusion model.
76
+
77
+ ```bash
78
+ # Download using provided script
79
+ python scripts/download_wan2.2.py
80
+
81
+ # Or manually download from Hugging Face
82
+ # Visit: https://huggingface.co/Wan-AI/Wan2.2-TI2V-5B
83
+ # Download to: models/Wan-AI/Wan2.2-TI2V-5B/
84
+ ```
85
+
86
+ ### Step 3: Download Panoworld Models
87
+
88
+ Download the 480p or 720p checkpoints:
89
+
90
+ ```bash
91
+ # Option 1: Using our download script
92
+ python scripts/download_panoworld_models.py
93
+
94
+ # Option 2: Manual download from Hugging Face
95
+ # Visit: https://huggingface.co/Insta360-Research/PanoWorld
96
+ ```
97
+
98
+ Final model directory structure:
99
+
100
+ ```
101
+ models/
102
+ β”œβ”€β”€ Wan-AI/
103
+ β”‚ └── Wan2.2-TI2V-5B/
104
+ β”œβ”€β”€ lora/
105
+ β”‚ β”œβ”€β”€ 480p/480p_lora.safetensors
106
+ β”‚ └── 720p/720p_lora.safetensors
107
+ β”œβ”€β”€ action/
108
+ β”‚ β”œβ”€β”€ 480p/480p_action.safetensors
109
+ β”‚ └── 720p/720p_action.safetensors
110
+ └── casual/
111
+ β”œβ”€β”€ dmd_chunkwise/model.pt
112
+ └── rolling_dmd_480p_161/model.pt
113
+ ```
114
+
115
+ ### Step 4: Install Causal-Forcing Package (Optional)
116
+
117
+ The Causal-Forcing stage requires additional dependencies:
118
+
119
+ Please refer to [Causal-Forcing/README.md](Casual-forcing/README.md) for installation instructions.
120
+
121
+
122
+ ## World360 Dataset
123
+
124
+
125
+ ![teaser](assets/dataset_13x13.gif)
126
+ World360 comprises 120,000 high-quality sequences, unifying 70,000 curated real-world clips with 50,000 high-fidelity simulations from AirSim360, and introduces diverse multi-altitude aerial trajectories with precise camera poses and depth information.
127
+
128
+
129
+
130
+
131
+ **Output**: Each dataset generates:
132
+
133
+ - 81-frame & 161-frame panoramic video.
134
+ - Camera trajectory csv file
135
+ - PNG image sequence
136
+
137
+
138
+
139
+
140
+ ## Inference
141
+
142
+ Bundled demo assets live under [`assets/demo/`](assets/demo/). Resolution-specific cases are under `480/` and `720/`; each case folder contains a **2:1 equirectangular** panorama (`input.jpg`), text prompt (`prompt.txt`), and camera trajectory (`pose.txt`). 720p cases also include a reference video (`reference_gen_joint_step2000.mp4`).
143
+
144
+
145
+
146
+
147
+ ### Camera-Controlled Video Generation
148
+
149
+ High-quality panoramic I2V with **camera trajectory control**.
150
+ Unified entry: [`inference_action.sh`](inference_action.sh)
151
+
152
+ **Output:** `{output}/gen_video.mp4` (single sample) or `gen_video_{i}.mp4` (batch).
153
+
154
+ ```bash
155
+ # --- Demo: image + prompt + synthetic forward motion ---
156
+ ./inference_action.sh \
157
+ --resolution 480 \
158
+ --image assets/demo/input.jpg \
159
+ --prompt "$(cat assets/demo/prompt.txt)" \
160
+ --motion forward \
161
+ --output ./inference_output/demo_forward
162
+
163
+ # --- Demo case with recorded pose (480p) ---
164
+ CASE=assets/demo/480/case2_waterway_slice000
165
+ ./inference_action.sh \
166
+ --resolution 480 \
167
+ --image ${CASE}/input.jpg \
168
+ --prompt "$(cat ${CASE}/prompt.txt)" \
169
+ --motion ${CASE}/pose.txt \
170
+ --output ${CASE}/out_action
171
+
172
+ # --- Demo case with recorded pose (720p) ---
173
+ CASE=assets/demo/720/case1_waterway_slice706
174
+ ./inference_action.sh \
175
+ --resolution 720 \
176
+ --image ${CASE}/input.jpg \
177
+ --prompt "$(cat ${CASE}/prompt.txt)" \
178
+ --motion ${CASE}/pose.txt \
179
+ --output ${CASE}/out_action
180
+
181
+ # 480p β€” single sample from test CSV
182
+ ./inference_action.sh \
183
+ --resolution 480 \
184
+ --prompt_nums 1 \
185
+ --output ./inference_output/demo_480p
186
+
187
+ # 720p β€” native 1408Γ—704, upscaled to 1440Γ—720
188
+ ./inference_action.sh \
189
+ --resolution 720 \
190
+ --prompt_nums 1 \
191
+ --output ./inference_output/demo_720p
192
+
193
+ # Or via top-level wrapper
194
+ RESOLUTION=480 PROMPT_NUMS=1 ./inference_preview.sh
195
+ RESOLUTION=720 PROMPT_NUMS=1 ./inference_preview.sh
196
+
197
+ python Action-Model/infer_action.py --help
198
+ ```
199
+
200
+ | Flag | Description |
201
+ |------|-------------|
202
+ | `--resolution` | `480` (960Γ—480) or `720` (1408Γ—704 β†’ 1440Γ—720) |
203
+ | `--image` / `--prompt` | Demo mode: panoramic image + text prompt (2:1 image) |
204
+ | `--motion` | `forward` / `backward` / `left` / `right` / `up` /`down` /, or a pose file (demo mode) |
205
+ | `--output` | Output directory |
206
+ | `--output_filename` | Default `gen_video.mp4` |
207
+ | `--prompt_path` | CSV with columns `video`, `short_prompt`, `pose_path` (batch mode) |
208
+ | `--prompt_nums` | Number of CSV rows to run (batch mode) |
209
+
210
+ Default test CSVs: `data_test.csv` (480p), `data_test_720p.csv` (720p).
211
+
212
+ ---
213
+
214
+ ### Causal Forcing Stage
215
+ Real-time panoramic generation with **Causal Forcing** on Wan2.2 5B.
216
+ Entry: [`Casual-forcing/inference_causal.sh`](Casual-forcing/inference_causal.sh) (conda env: `causal_forcing`).
217
+
218
+ **Output:** `{output}/causal_video.mp4`
219
+
220
+ ```bash
221
+ conda activate causal_forcing
222
+ cd Casual-forcing
223
+
224
+ # --- Quick demo (root assets, 480p case1) ---
225
+ ./inference_causal.sh \
226
+ --image ../assets/demo/input.jpg \
227
+ --prompt "$(cat ../assets/demo/prompt.txt)" \
228
+ --output ../assets/demo/out_short
229
+
230
+ # --- Demo case with recorded pose ---
231
+ CASE=../assets/demo/480/case2_waterway_slice000
232
+ ./inference_causal.sh \
233
+ --image ${CASE}/input.jpg \
234
+ --prompt "$(cat ${CASE}/prompt.txt)" \
235
+ --motion ${CASE}/pose.txt \
236
+ --output ${CASE}/out_pose
237
+
238
+ # --- 161-frame long video (Rolling Forcing) ---
239
+ CASE=../assets/demo/480/case1_park_slice002
240
+ ./inference_causal.sh \
241
+ --image ${CASE}/input.jpg \
242
+ --prompt "$(cat ${CASE}/prompt.txt)" \
243
+ --motion ${CASE}/pose.txt \
244
+ --frames 161 \
245
+ --output ${CASE}/out_long
246
+
247
+ # --- Synthetic motion presets ---
248
+ ./inference_causal.sh \
249
+ --image ../assets/demo/input.jpg \
250
+ --prompt "$(cat ../assets/demo/prompt.txt)" \
251
+ --motion forward \
252
+ --output ../assets/demo/out_forward
253
+
254
+ python infer_causal.py --help
255
+ ```
256
+
257
+ | Flag | Description |
258
+ |------|-------------|
259
+ | `--frames` | `81` (short, default) or `161` (long / Rolling Forcing) |
260
+ | `--motion` | `forward` / `backward` / `left` / `right`, or a pose file (`.txt` / `.csv` / `.npy`) |
261
+ | `--output` | Output directory; video is always `causal_video.mp4` |
262
+ ---
263
+
264
+ ### Memory Preview
265
+
266
+ > **Coming soon.** Long-range memory-augmented 720p inference (161-frame) will be released in a future update.
267
+
268
+ ---
269
+
270
+ ## Training
271
+
272
+ PanoWorld training is organized in stages:
273
+
274
+ ```
275
+ Stage 1 Video LoRA β†’ output/lora_480p | lora_720p
276
+ Stage 2 Action Model β†’ output/action_480p | action_720p (requires Stage 1)
277
+ Stage 3 Memory β†’ coming soon
278
+ Stage 4 Causal Forcing β†’ Casual-forcing/logs/ (480p, see below)
279
+ ```
280
+
281
+ Use `RESOLUTION=480|720` to switch presets (Matrix-3D convention). Config: [`configs/resolution.yaml`](configs/resolution.yaml).
282
+
283
+
284
+
285
+ Training CSVs must include panoramic video paths and text prompts. Override defaults with `DATA_CSV=/path/to/your.csv`.
286
+
287
+ | Resolution | Native train | Output | LoRA rank |
288
+ |------------|-------------|--------|-----------|
289
+ | **480** | 960Γ—480 | 960Γ—480 | 64 |
290
+ | **720** | 1408Γ—704 | 1440Γ—720 (inference upscale) | 256 |
291
+
292
+ ---
293
+
294
+ ### Stage 1 β€” Video LoRA
295
+
296
+ Fine-tune Wan2.2 I2V with LoRA for panoramic video generation (81 frames, no camera control module).
297
+
298
+ ```bash
299
+ # 480p
300
+ RESOLUTION=480 bash scripts/train/01_video_lora.sh
301
+
302
+ # 720p (recommended for Action Model 720p)
303
+ RESOLUTION=720 bash scripts/train/01_video_lora.sh
304
+ ```
305
+
306
+
307
+ Checkpoints are saved under `{OUTPUT}/checkpoints/` with `latest.json` for resume.
308
+
309
+ Legacy wrappers: `scripts/train/01_video_lora_480p.sh`, `01_video_lora_720p.sh`.
310
+
311
+ ---
312
+
313
+ ### Stage 2 β€” Action Model
314
+
315
+ Freeze LoRA and train the `cam_self_attn` camera-control module (trajectory-conditioned I2V). **Requires Stage 1 LoRA.**
316
+
317
+ ```bash
318
+ # After Stage 1 completes
319
+ RESOLUTION=480 bash scripts/train/02_action.sh
320
+ RESOLUTION=720 bash scripts/train/02_action.sh
321
+
322
+ # Warm-start from a simulation-pretrained action checkpoint (optional)
323
+ INIT_ACTION=/path/to/simulation_action.safetensors \
324
+ RESOLUTION=720 bash scripts/train/02_action.sh
325
+ ```
326
+
327
+
328
+ Checkpoints: `{OUTPUT}/checkpoints/`. Use the latest action weights with [`inference_action.sh`](inference_action.sh) for preview inference.
329
+
330
+ 720p project-specific script (hardcoded paths): [`Action-Model/train_720p.sh`](Action-Model/train_720p.sh).
331
+
332
+ ---
333
+
334
+ ### Stage 3 β€” Memory
335
+
336
+ > **Coming soon.**
337
+
338
+ ---
339
+
340
+ ### Stage 4 β€” Causal Forcing
341
+
342
+ See [Casual-forcing/README.md](Casual-forcing/README.md) for installation and training.
343
+
344
+ ### Checkpoint Layout
345
+
346
+ ```
347
+ output/
348
+ β”œβ”€β”€ lora_480p/checkpoints/
349
+ β”œβ”€β”€ lora_720p/checkpoints/
350
+ β”œβ”€β”€ action_480p/checkpoints/
351
+ └── action_720p/checkpoints/
352
+ Casual-forcing/logs/ # Causal Forcing training outputs
353
+ ```
354
+
355
+ ## Project Structure
356
+
357
+ ```
358
+ PanoWorld/
359
+ β”œβ”€β”€ assets/demo/ # Demo inputs (480/720 cases: input, prompt, pose)
360
+ β”‚ β”œβ”€β”€ 480/ # 960Γ—480 cases
361
+ β”‚ └── 720/ # 1408Γ—704 cases (+ reference_gen_*.mp4)
362
+ β”œβ”€β”€ inference_action.sh # Action Model unified entry β†’ gen_video.mp4
363
+ β”œβ”€β”€ Action-Model/ # Action Model Python scripts (480p / 720p)
364
+ β”‚ └── infer_action.py # unified CLI
365
+ β”œβ”€β”€ Casual-forcing/ # Causal Forcing inference & training
366
+ β”‚ β”œβ”€β”€ infer_causal.py # unified CLI β†’ causal_video.mp4
367
+ β”‚ └── inference_causal.sh
368
+ β”œβ”€β”€ diffsynth/ # Shared DiffSynth modules
369
+ β”œβ”€β”€ scripts/train/ # Staged training launchers (01–04)
370
+ β”œβ”€β”€ models/ # Wan2.2 base + PanoWorld checkpoints
371
+ β”‚ β”œβ”€β”€ lora/ # Video LoRA (480p / 720p)
372
+ β”‚ β”œβ”€β”€ action/ # Action Model (480p / 720p)
373
+ β”‚ └── casual/ # Causal Forcing inference weights
374
+ β”œβ”€β”€ inference_preview.sh # RESOLUTION=480|720 wrapper
375
+ └── configs/resolution.yaml # 480 / 720 presets
376
+ ```
377
+
378
+ ## Acknowledgments
379
+
380
+ We thank the following projects for their inspiring work, our code is partially based on the code from these projects:
381
+ - **[Wan-AI](https://huggingface.co/Wan-AI)**: Base video diffusion model
382
+
383
+ - **[UCPE](https://github.com/chengzhag/UCPE)**: Camera-controlled text-to-video generation.
384
+ - **[Causal-Forcing](https://github.com/thu-ml/Causal-Forcing)**: Causal-Forcing distillation for fast diffusion models
385
+
386
+
387
+ ## Citation
388
+
389
+ If you find Panoworld useful for your research, please cite:
390
+
391
+ ```bibtex
392
+ @article{
393
+ }
394
+ ```
395
+
396
+
397
+