How tencent-hunyuan/hunyuanworld-mirror works
HunyuanWorld-Mirror is a feed-forward 3D geometry prediction system with an interactive demo, inference utilities, train/evaluation code, and a Gaussian-splat rendering path. The principal workflow accepts image sequences plus optional camera-pose, depth, and intrinsics priors; predicts camera and dense geometry representations; optionally renders 3D Gaussians; and exposes visualized or saved results. Training and evaluation are separate product capabilities. Some subsystem links rely on README claims or SOURCE INDEX references because their implementation excerpts were not provided.
Main entry points: worldmirror.py WorldMirror forward pass · app.py Interactive demo · wrapper.py Training wrapper · rasterization.py Gaussian splat preparation
Components 20
User interaction
- Interactive demo
app.py - Image and prior loading
src/utils/inference_utils.py - Visualization and exports
src/utils/visual_util.py - Result saving
src/utils/save_utils.py
Prediction model
- WorldMirror forward pass
src/models/models/worldmirror.py - Visual geometry transformer
src/models/models/visual_transformer.py - Prior encoding
src/models/utils/priors.py - Camera prediction
src/models/heads/camera_head.py - Dense geometry prediction
src/models/heads/dense_head.py - Camera geometry utilities
src/models/utils/camera_utils.py
3D Gaussian rendering
- Gaussian splat preparation
src/models/models/rasterization.py - Render and post-process
src/utils/render_utils.py
Training and evaluation
- Multiview data
training/data/multiview_dataset.py - Training wrapper
training/wrapper.py - Training losses
training/losses/container.py - Task evaluation
training/utils/eval
gsplat backend
- Gaussian rasterization
submodules/gsplat/gsplat/rendering.py - CUDA and Torch operations
submodules/gsplat/gsplat/cuda/_wrapper.py
Other components
- User
- Saved predictions
Connections 21
- User → Interactive demo: submits inputs
README.md - Interactive demo → Image and prior loading: preprocesses images
app.py - Image and prior loading → WorldMirror forward pass: provides tensors
- Interactive demo → WorldMirror forward pass: runs inference
app.py - WorldMirror forward pass → Visual geometry transformer: encodes views
src/models/models/worldmirror.py - WorldMirror forward pass → Prior encoding: normalizes priors
src/models/models/worldmirror.py - WorldMirror forward pass → Camera prediction: predicts cameras
src/models/models/worldmirror.py - WorldMirror forward pass → Dense geometry prediction: predicts geometry
src/models/models/worldmirror.py - WorldMirror forward pass → Gaussian splat preparation: renders predictions
src/models/models/worldmirror.py - Camera prediction → Camera geometry utilities: uses conversions
- Gaussian splat preparation → Gaussian rasterization: calls rasterizer
src/models/models/rasterization.py - Gaussian rasterization → CUDA and Torch operations: dispatches operations
submodules/gsplat/gsplat/rendering.py - Interactive demo → Render and post-process: renders results
app.py - Interactive demo → Visualization and exports: builds scene views
app.py - Interactive demo → Result saving: exports outputs
app.py - Result saving → Saved predictions: writes files
- Multiview data → Training wrapper: supplies batches
- Training wrapper → WorldMirror forward pass: trains model
training/wrapper.py - Training wrapper → Training losses: computes losses
- Training wrapper → Task evaluation: evaluates tasks
training/wrapper.py - Render and post-process → Gaussian splat preparation: uses rendering
src/utils/render_utils.py