# nvlabs/gaussianstorm architecture

> Architecture diagram of the GitHub repository nvlabs/gaussianstorm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nvlabs/gaussianstorm
- Repository: https://github.com/nvlabs/gaussianstorm

## Overview

1. **What this repo is**
   - STORM is a research codebase for **feed-forward dynamic scene reconstruction** in large outdoor environments.
   - The core output is a **3D Gaussian scene representation** plus **scene flow**, enabling rendering and motion reasoning from sparse multi-view video.

2. **Top-level execution entry points**
   - `main_storm.py` is the main **training / evaluation** launcher.
   - `inference.py` is the **single-run demo / playback** path for running a checkpoint on a sequence.
   - `engine_storm.py` likely contains the shared **training/evaluation loop orchestration** used by `main_storm.py`.
   - `preprocess.py` and `extract_sky.py` are supporting scripts for dataset preparation and auxiliary label extraction.

3. **Data preparation boundary**
   - Raw data is not consumed directly by the model. The repo expects a **preprocessed dataset layout**.
   - `preproc/waymo_download.py` and `preproc/waymo_preprocess.py` handle **Waymo Open Dataset acquisition and conversion**.
   - `docs/WAYMO.md` and `docs/example_data/` show the expected input format and sample scene metadata.
   - `data/dataset_scene_list/*.txt` defines the scene splits used by training/validation.

4. **Dataset subsystem**
   - `storm/dataset/storm_dataset.py` is the central dataset implementation.
   - `storm/dataset/data_utils.py`, `constants.py`, and `samplers.py` support frame/sequence assembly, coordinate or metadata constants, and sampling strategy.
   - This layer is the main boundary between **preprocessed scene files** and the **model’s batched tensors**.

5. **Model subsystem**
   - `storm/models/storm.py` is the main model definition.
   - Supporting model pieces are split by role:
     - `embedders.py` for token / feature embedding
     - `layers.py` for reusable neural blocks
     - `decoder.py` for predicting outputs from latent features
     - `vit.py` for vision-transformer-style image encoding
   - The model is likely built to fuse **multi-view appearance**, **motion tokens**, and optional auxiliary inputs like depth/flow/ground/sky.

6. **Geometry and rendering-oriented design**
   - The README emphasizes joint learning of **3D Gaussians** and **scene flow**, so the model is not just frame reconstruction—it also learns temporal motion structure.
   - `gsplat` is an important external dependency because it provides **batch-wise Gaussian rendering** support.
   - That means the architecture has an implicit split between:
     - feature prediction / scene parameter prediction
     - differentiable rendering / reconstruction supervision

7. **Auxiliary pretrained perception backbone**
   - `third_party/depth_anything_v2/` vendors a Depth Anything V2 implementation.
   - This is a separate dependency boundary, likely used for **depth-related supervision or initialization** rather than being the core STORM model itself.
   - The presence of `extract_sky.py`, `load_depth`, `load_flow`, and `load_ground` options in the README suggests the pipeline can ingest several **auxiliary geometric/semantic signals**.

8. **Training and distributed execution**
   - `storm/utils/distributed.py` provides the multi-GPU / multi-process glue used by `torchrun`.
   - `storm/utils/losses.py`, `lpips.py`, and `lpips_loss.py` indicate a training objective that mixes **photometric**, **perceptual**, and task-specific regularization terms.
   - `storm/utils/logging.py` and `misc.py` handle experiment bookkeeping, reproducibility, and general helpers.
   - Training outputs are stored under `work_dirs/<project>/<exp_name>` per the README.

9. **Inference and evaluation flow**
   - `inference.py` is the lightweight path for loading a checkpoint and rendering a scene without running full training.
   - Evaluation is driven through the same main entrypoint as training, but with an `--evaluate` switch, so training and evaluation share model code and dataset handling.
   - This suggests a single unified model stack with different runtime modes rather than separate training and inference implementations.

10. **Visualization subsystem**
    - `storm/visualization/annotation.py`, `layout.py`, `video_maker.py`, and `visualization_tools.py` are dedicated to **rendering results for qualitative inspection**.
    - This layer likely consumes model outputs and turns them into annotated images/videos, separating visualization from core training logic.
    - The README’s mention of a future “viewer” aligns with this module’s current role as an offline visualization pipeline.

11. **Where the main data flows go**
    - **Raw Waymo scenes** → preprocessing scripts → preprocessed scene artifacts and split lists.
    - **Prepared dataset files** → `StormDataset` → batched tensors via samplers/collation.
    - **Batched inputs** → STORM model → predicted scene representation, flow, and auxiliary outputs.
    - **Predictions + labels** → losses during training, or renderings/videos during inference/visualization.

12. **External dependencies that matter architecturally**
    - **Waymo Open Dataset** is the primary data source.
    - **PyTorch** is the runtime and model training framework.
    - **CUDA / multi-GPU torchrun** is the intended execution mode for training.
    - **gsplat** is a required rendering backend for Gaussian splatting.
    - **Depth Anything V2** is vendored as a third-party module for depth-related functionality.

13. **How to think about repo boundaries in a diagram**
    - One boundary is **data preparation vs. model runtime**.
    - Another is **core STORM model code vs. third-party perception/rendering dependencies**.
    - A third is **training/evaluation logic vs. visualization/export logic**.
    - The repo is organized so that the training engine and inference path both depend on the same dataset/model stack, while preprocessing is mostly upstream and visualization is mostly downstream.

Main entry points: [`storm/models/storm.py`](https://github.com/nvlabs/gaussianstorm/blob/main/storm/models/storm.py) (STORM), [`storm/dataset/storm_dataset.py`](https://github.com/nvlabs/gaussianstorm/blob/main/storm/dataset/storm_dataset.py) (StormDataset), [`engine_storm.py`](https://github.com/nvlabs/gaussianstorm/blob/main/engine_storm.py) (engine_storm.py), [`storm/visualization/visualization_tools.py`](https://github.com/nvlabs/gaussianstorm/blob/main/storm/visualization/visualization_tools.py) (visual tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry points"]
  node_main_storm["main_storm.py<br/>trainer/eval launcher<br/>[main_storm.py]"]
  node_engine_storm["engine_storm.py<br/>run loop<br/>[engine_storm.py]"]
  node_inference["inference.py<br/>single-run inference<br/>[inference.py]"]
  node_preprocess["preprocess.py<br/>prep launcher<br/>[preprocess.py]"]
  node_extract_sky["extract_sky.py<br/>aux label script<br/>[extract_sky.py]"]
end

subgraph group_prep["Data prep"]
  node_waymo_download["waymo_download.py<br/>dataset download<br/>[waymo_download.py]"]
  node_waymo_preprocess["waymo_preprocess.py<br/>dataset convert"]
  node_waymo_docs["WAYMO.md<br/>data spec<br/>[WAYMO.md]"]
  node_scene_lists["scene lists<br/>split manifests"]
end

subgraph group_core["Core STORM"]
  node_storm_dataset["StormDataset<br/>dataset boundary<br/>[storm_dataset.py]"]
  node_data_utils["data utils<br/>dataset helpers<br/>[data_utils.py]"]
  node_samplers["samplers<br/>sampling policy<br/>[samplers.py]"]
  node_storm_model["STORM<br/>scene model<br/>[storm.py]"]
  node_embedders["embedders<br/>feature embed<br/>[embedders.py]"]
  node_layers["layers<br/>neural blocks<br/>[layers.py]"]
  node_decoder["decoder<br/>output head<br/>[decoder.py]"]
  node_vit["ViT encoder<br/>image encoder<br/>[vit.py]"]
  node_losses["losses<br/>training objectives<br/>[losses.py]"]
  node_dist["distributed<br/>multi-gpu glue<br/>[distributed.py]"]
  node_logging["logging<br/>experiment logs<br/>[logging.py]"]
end

subgraph group_viz["Visualization"]
  node_vis_tools["visual tools<br/>render/export"]
  node_video_maker["video maker<br/>video export<br/>[video_maker.py]"]
  node_annotation["annotation<br/>overlay tools<br/>[annotation.py]"]
  node_layout["layout<br/>composition<br/>[layout.py]"]
end

subgraph group_vendor["Vendor deps"]
  node_depth_anything["Depth Anything V2<br/>vendor backbone"]
end

node_main_storm -->|"uses"| node_engine_storm
node_main_storm -->|"loads data"| node_storm_dataset
node_main_storm -->|"trains/evals"| node_storm_model
node_engine_storm -->|"optimizes"| node_losses
node_engine_storm -->|"distributed"| node_dist
node_engine_storm -->|"records"| node_logging
node_inference -->|"loads data"| node_storm_dataset
node_inference -->|"renders"| node_storm_model
node_preprocess -->|"downloads"| node_waymo_download
node_preprocess -->|"converts"| node_waymo_preprocess
node_waymo_download -->|"feeds"| node_waymo_preprocess
node_waymo_preprocess -->|"writes"| node_scene_lists
node_storm_dataset -->|"assembles"| node_data_utils
node_storm_dataset -->|"samples"| node_samplers
node_scene_lists -->|"drives splits"| node_storm_dataset
node_storm_model -->|"encodes"| node_vit
node_storm_model -->|"embeds"| node_embedders
node_storm_model -->|"builds from"| node_layers
node_storm_model -->|"predicts"| node_decoder
node_storm_model -.->|"aux depth"| node_depth_anything
node_storm_model -->|"supervised by"| node_losses
node_storm_model -->|"exports"| node_vis_tools
node_vis_tools -->|"annotates"| node_annotation
node_vis_tools -->|"formats"| node_layout
node_vis_tools -->|"packages"| node_video_maker
node_video_maker -->|"uses"| node_annotation

click node_main_storm "https://github.com/nvlabs/gaussianstorm/blob/main/main_storm.py"
click node_engine_storm "https://github.com/nvlabs/gaussianstorm/blob/main/engine_storm.py"
click node_inference "https://github.com/nvlabs/gaussianstorm/blob/main/inference.py"
click node_preprocess "https://github.com/nvlabs/gaussianstorm/blob/main/preprocess.py"
click node_extract_sky "https://github.com/nvlabs/gaussianstorm/blob/main/extract_sky.py"
click node_waymo_download "https://github.com/nvlabs/gaussianstorm/blob/main/preproc/waymo_download.py"
click node_waymo_preprocess "https://github.com/nvlabs/gaussianstorm/blob/main/preproc/waymo_preprocess.py"
click node_waymo_docs "https://github.com/nvlabs/gaussianstorm/blob/main/docs/WAYMO.md"
click node_scene_lists "https://github.com/nvlabs/gaussianstorm/tree/main/data/dataset_scene_list"
click node_storm_dataset "https://github.com/nvlabs/gaussianstorm/blob/main/storm/dataset/storm_dataset.py"
click node_data_utils "https://github.com/nvlabs/gaussianstorm/blob/main/storm/dataset/data_utils.py"
click node_samplers "https://github.com/nvlabs/gaussianstorm/blob/main/storm/dataset/samplers.py"
click node_storm_model "https://github.com/nvlabs/gaussianstorm/blob/main/storm/models/storm.py"
click node_embedders "https://github.com/nvlabs/gaussianstorm/blob/main/storm/models/embedders.py"
click node_layers "https://github.com/nvlabs/gaussianstorm/blob/main/storm/models/layers.py"
click node_decoder "https://github.com/nvlabs/gaussianstorm/blob/main/storm/models/decoder.py"
click node_vit "https://github.com/nvlabs/gaussianstorm/blob/main/storm/models/vit.py"
click node_losses "https://github.com/nvlabs/gaussianstorm/blob/main/storm/utils/losses.py"
click node_dist "https://github.com/nvlabs/gaussianstorm/blob/main/storm/utils/distributed.py"
click node_logging "https://github.com/nvlabs/gaussianstorm/blob/main/storm/utils/logging.py"
click node_vis_tools "https://github.com/nvlabs/gaussianstorm/blob/main/storm/visualization/visualization_tools.py"
click node_video_maker "https://github.com/nvlabs/gaussianstorm/blob/main/storm/visualization/video_maker.py"
click node_annotation "https://github.com/nvlabs/gaussianstorm/blob/main/storm/visualization/annotation.py"
click node_layout "https://github.com/nvlabs/gaussianstorm/blob/main/storm/visualization/layout.py"
click node_depth_anything "https://github.com/nvlabs/gaussianstorm/tree/main/third_party/depth_anything_v2"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main_storm,node_engine_storm,node_inference,node_preprocess,node_extract_sky toneBlue
class node_waymo_download,node_waymo_preprocess,node_waymo_docs,node_scene_lists toneAmber
class node_storm_dataset,node_data_utils,node_samplers,node_storm_model,node_embedders,node_layers,node_decoder,node_vit,node_losses,node_dist,node_logging toneMint
class node_vis_tools,node_video_maker,node_annotation,node_layout toneRose
class node_depth_anything toneIndigo
```

## Components

### Entry points

Training, evaluation, inference, and preprocessing launchers.

- [main_storm.py](https://github.com/nvlabs/gaussianstorm/blob/main/main_storm.py): trainer/eval launcher · Primary entry point for training and evaluation runs. · `main_storm.py`
- [engine_storm.py](https://github.com/nvlabs/gaussianstorm/blob/main/engine_storm.py): run loop · Shared orchestration for training and evaluation. · `engine_storm.py`
- [inference.py](https://github.com/nvlabs/gaussianstorm/blob/main/inference.py): single-run inference · Loads a checkpoint and runs scene playback or demo inference. · `inference.py`
- [preprocess.py](https://github.com/nvlabs/gaussianstorm/blob/main/preprocess.py): prep launcher · Top-level preprocessing helper script. · `preprocess.py`
- [extract_sky.py](https://github.com/nvlabs/gaussianstorm/blob/main/extract_sky.py): aux label script · Auxiliary script for extracting sky-related inputs or labels. · `extract_sky.py`

### Data prep

Waymo acquisition, conversion, and dataset split assets.

- [waymo_download.py](https://github.com/nvlabs/gaussianstorm/blob/main/preproc/waymo_download.py): dataset download · Downloads Waymo data for preprocessing. · `preproc/waymo_download.py`
- [waymo_preprocess.py](https://github.com/nvlabs/gaussianstorm/blob/main/preproc/waymo_preprocess.py): dataset convert · Converts Waymo scenes into the repository's preprocessed format. · `preproc/waymo_preprocess.py`
- [WAYMO.md](https://github.com/nvlabs/gaussianstorm/blob/main/docs/WAYMO.md): data spec · Documents the expected Waymo input and scene layout. · `docs/WAYMO.md`
- [scene lists](https://github.com/nvlabs/gaussianstorm/tree/main/data/dataset_scene_list): split manifests · Training and validation scene split definitions. · `data/dataset_scene_list`

### Core STORM

Dataset, model, rendering-aware prediction, and shared utilities.

- [StormDataset](https://github.com/nvlabs/gaussianstorm/blob/main/storm/dataset/storm_dataset.py): dataset boundary · Main dataset implementation mapping preprocessed scenes to batched tensors. · `storm/dataset/storm_dataset.py`
- [data utils](https://github.com/nvlabs/gaussianstorm/blob/main/storm/dataset/data_utils.py): dataset helpers · Frame assembly, metadata handling, and sequence utilities. · `storm/dataset/data_utils.py`
- [samplers](https://github.com/nvlabs/gaussianstorm/blob/main/storm/dataset/samplers.py): sampling policy · Sampling strategy for sequences and frames. · `storm/dataset/samplers.py`
- [STORM](https://github.com/nvlabs/gaussianstorm/blob/main/storm/models/storm.py): scene model · Main model predicting 3D Gaussians, scene flow, and auxiliary outputs. · `storm/models/storm.py`
- [embedders](https://github.com/nvlabs/gaussianstorm/blob/main/storm/models/embedders.py): feature embed · Token and feature embedding modules. · `storm/models/embedders.py`
- [layers](https://github.com/nvlabs/gaussianstorm/blob/main/storm/models/layers.py): neural blocks · Reusable model blocks and internal components. · `storm/models/layers.py`
- [decoder](https://github.com/nvlabs/gaussianstorm/blob/main/storm/models/decoder.py): output head · Maps latent features to scene predictions. · `storm/models/decoder.py`
- [ViT encoder](https://github.com/nvlabs/gaussianstorm/blob/main/storm/models/vit.py): image encoder · Vision-transformer style multi-view image encoding. · `storm/models/vit.py`
- [losses](https://github.com/nvlabs/gaussianstorm/blob/main/storm/utils/losses.py): training objectives · Photometric, perceptual, and task-specific loss terms. · `storm/utils/losses.py`
- [distributed](https://github.com/nvlabs/gaussianstorm/blob/main/storm/utils/distributed.py): multi-gpu glue · Distributed training and process coordination utilities. · `storm/utils/distributed.py`
- [logging](https://github.com/nvlabs/gaussianstorm/blob/main/storm/utils/logging.py): experiment logs · Run bookkeeping and experiment logging. · `storm/utils/logging.py`

### Visualization

Offline qualitative inspection and video generation.

- [visual tools](https://github.com/nvlabs/gaussianstorm/blob/main/storm/visualization/visualization_tools.py): render/export · High-level visualization helpers for qualitative outputs. · `storm/visualization/visualization_tools.py`
- [video maker](https://github.com/nvlabs/gaussianstorm/blob/main/storm/visualization/video_maker.py): video export · Builds annotated result videos from model outputs. · `storm/visualization/video_maker.py`
- [annotation](https://github.com/nvlabs/gaussianstorm/blob/main/storm/visualization/annotation.py): overlay tools · Adds labels and overlays to rendered outputs. · `storm/visualization/annotation.py`
- [layout](https://github.com/nvlabs/gaussianstorm/blob/main/storm/visualization/layout.py): composition · Arranges panels and visualization layouts. · `storm/visualization/layout.py`

### Vendor deps

Third-party perception backbone used alongside the main model.

- [Depth Anything V2](https://github.com/nvlabs/gaussianstorm/tree/main/third_party/depth_anything_v2): vendor backbone · Vendored depth perception backbone used for auxiliary geometric signals. · `third_party/depth_anything_v2`

## Connections

- main_storm.py → engine_storm.py: uses · Training and evaluation execution is orchestrated through the shared engine.
- main_storm.py → StormDataset: loads data · Main runs consume preprocessed scenes through the dataset layer.
- main_storm.py → STORM: trains/evals · Launcher instantiates and runs the core STORM model.
- engine_storm.py → losses: optimizes · The engine applies the training objectives during optimization.
- engine_storm.py → distributed: distributed · Multi-GPU and multi-process execution are coordinated here.
- engine_storm.py → logging: records · Training and evaluation runs emit logs and experiment state.
- inference.py → StormDataset: loads data · Inference uses the same prepared dataset boundary.
- inference.py → STORM: renders · Checkpoint loading and prediction reuse the core model stack.
- preprocess.py → waymo_download.py: downloads · Top-level preprocessing can fetch Waymo sources.
- preprocess.py → waymo_preprocess.py: converts · Top-level preprocessing converts raw data into repo format.
- waymo_download.py → waymo_preprocess.py: feeds · Downloaded Waymo data is handed to preprocessing.
- waymo_preprocess.py → scene lists: writes · Converted scenes align with train/val split manifests.
- StormDataset → data utils: assembles · Dataset assembly relies on shared frame and metadata utilities.
- StormDataset → samplers: samples · Sampling policy controls which sequences and frames are batched.
- scene lists → StormDataset: drives splits · Scene split manifests determine which samples are loaded.
- STORM → ViT encoder: encodes · Multi-view imagery is encoded through a ViT-style backbone.
- STORM → embedders: embeds · Inputs and latent tokens are transformed by embedding modules.
- STORM → layers: builds from · Reusable blocks compose the internal model architecture.
- STORM → decoder: predicts · Latent features are decoded into scene parameters and outputs.
- STORM → Depth Anything V2: aux depth · Vendored depth backbone supports auxiliary geometric inputs or supervision.
- STORM → losses: supervised by · Predictions are compared against targets with mixed objectives.
- STORM → visual tools: exports · Model outputs can be passed into visualization and rendering helpers.
- visual tools → annotation: annotates · Visualization pipelines add text and overlays.
- visual tools → layout: formats · Panels and scenes are arranged for inspection.
- visual tools → video maker: packages · Outputs can be assembled into qualitative videos.
- video maker → annotation: uses · Video export reuses annotation overlays.
