# offthegridgs/offthegrid architecture

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

- Interactive diagram: https://gitdiagram.com/offthegridgs/offthegrid
- Repository: https://github.com/offthegridgs/offthegrid

## Overview

Off The Grid is a pose-free, feed-forward 3D Gaussian Splatting system. Its primary workflow takes an uncalibrated image sequence through image loading, a geometry encoder, and a Gaussian-detection decoder, then renders or exports the predicted scene. Separate entry points support self-supervised training and benchmark evaluation. The graph includes documented inference outputs and major encoder/baseline options; source excerpts are partial, so some subsystem relationships rely on the SOURCE INDEX or README rather than inspected implementation details.

Main entry points: [`src/models/off_the_grid.py`](https://github.com/offthegridgs/offthegrid/blob/main/src/models/off_the_grid.py) (Off The Grid model), [`simple_inference.py`](https://github.com/offthegridgs/offthegrid/blob/main/simple_inference.py) (Simple inference), [`evaluation.py`](https://github.com/offthegridgs/offthegrid/blob/main/evaluation.py) (Benchmark evaluation), [`train.py`](https://github.com/offthegridgs/offthegrid/blob/main/train.py) (Training entry points)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inference["Inference and exports"]
  node_inference_entry["Simple inference"]
  node_trajectory["Trajectory generation"]
  node_colmap_export["COLMAP export<br/>[colmap_utils.py]"]
  node_mesh_export["Mesh export<br/>[mesh_utils.py]"]
  node_visual_outputs["Visualization and video<br/>[os_utils.py]"]
end

subgraph group_model["Reconstruction model"]
  node_otg_model["Off The Grid model<br/>[off_the_grid.py]"]
  node_vggt_encoder["VGGT encoder<br/>[vggt_encoder.py]"]
  node_da3_encoder["DepthAnything3 encoder"]
  node_omega_encoder["VGGT Omega encoder"]
  node_gaussian_decoder["Gaussian decoder"]
  node_decoder_layers["Decoder layers<br/>[layers.py]"]
  node_baseline["DA3 Gaussian baseline<br/>[baselines.py]"]
end

subgraph group_data["Datasets and loading"]
  node_image_dataset["Inference image dataset"]
  node_image_loading["Image preprocessing<br/>[load_utils.py]"]
  node_training_data["Multi-resolution training data"]
  node_multigpu_data["Multi-GPU training data"]
  node_charge_data["Charge benchmark dataset<br/>[Charge_dataset.py]"]
  node_scrream_data["SCRREAM benchmark dataset<br/>[scrream_dataset.py]"]
end

subgraph group_train["Training and evaluation"]
  node_training_entry["Training entry points<br/>[train.py]"]
  node_decoder_training["Decoder-only training"]
  node_multigpu_training["Multi-GPU training<br/>[train_multigpu.py]"]
  node_evaluation_entry["Benchmark evaluation<br/>[evaluation.py]"]
end

subgraph group_geometry["Geometry and metrics"]
  node_gaussian_ops["Gaussian rendering and utilities<br/>[gaussians_utils.py]"]
  node_eval_metrics["Evaluation metrics<br/>[metrics_utils.py]"]
  node_eval_helpers["Evaluation helpers<br/>[eval_utils.py]"]
  node_alignment["Camera alignment<br/>[alignment_utils.py]"]
  node_geometry_ops["Camera and depth geometry<br/>[geometry_utils.py]"]
  node_losses["Training losses<br/>[loss_utils.py]"]
  node_adaptive_density["Adaptive density"]
end

node_user(("Image-sequence user"))

node_user -->|"provides images"| node_inference_entry
node_inference_entry -->|"loads sequence"| node_image_dataset
node_image_dataset -->|"preprocesses images"| node_image_loading
node_inference_entry -->|"runs inference"| node_otg_model
node_otg_model -->|"uses encoder"| node_vggt_encoder
node_otg_model -->|"uses encoder"| node_da3_encoder
node_otg_model -->|"supports encoder"| node_omega_encoder
node_otg_model -->|"decodes primitives"| node_gaussian_decoder
node_gaussian_decoder -->|"uses layers"| node_decoder_layers
node_otg_model -->|"renders Gaussians"| node_gaussian_ops
node_inference_entry -->|"generates views"| node_trajectory
node_inference_entry -->|"exports cameras"| node_colmap_export
node_inference_entry -->|"exports mesh"| node_mesh_export
node_inference_entry -->|"saves outputs"| node_visual_outputs
node_inference_entry -->|"visualizes density"| node_adaptive_density
node_training_entry -->|"trains model"| node_otg_model
node_decoder_training -->|"trains decoder"| node_otg_model
node_multigpu_training -->|"trains model"| node_otg_model
node_training_entry -->|"loads training data"| node_training_data
node_decoder_training -->|"loads training data"| node_training_data
node_multigpu_training -->|"loads training data"| node_multigpu_data
node_training_entry -->|"uses dataset"| node_charge_data
node_training_entry -->|"uses dataset"| node_scrream_data
node_evaluation_entry -->|"evaluates model"| node_otg_model
node_evaluation_entry -->|"evaluates baseline"| node_baseline
node_evaluation_entry -->|"loads benchmark"| node_charge_data
node_evaluation_entry -->|"loads benchmark"| node_scrream_data
node_evaluation_entry -->|"computes metrics"| node_eval_metrics
node_evaluation_entry -->|"computes evaluation"| node_eval_helpers
node_evaluation_entry -->|"aligns cameras"| node_alignment
node_otg_model -->|"computes losses"| node_losses
node_otg_model -->|"uses geometry"| node_geometry_ops
node_baseline -->|"uses encoder"| node_da3_encoder

click node_inference_entry "https://github.com/offthegridgs/offthegrid/blob/main/simple_inference.py"
click node_image_dataset "https://github.com/offthegridgs/offthegrid/blob/main/src/datasets/simple_inference_dataset.py"
click node_image_loading "https://github.com/offthegridgs/offthegrid/blob/main/src/utils/load_utils.py"
click node_otg_model "https://github.com/offthegridgs/offthegrid/blob/main/src/models/off_the_grid.py"
click node_vggt_encoder "https://github.com/offthegridgs/offthegrid/blob/main/src/models/geometry_encoders/vggt_encoder.py"
click node_da3_encoder "https://github.com/offthegridgs/offthegrid/blob/main/src/models/geometry_encoders/depthanything3_encoder.py"
click node_omega_encoder "https://github.com/offthegridgs/offthegrid/blob/main/src/models/geometry_encoders/vggt_omega_encoder.py"
click node_gaussian_decoder "https://github.com/offthegridgs/offthegrid/blob/main/src/models/gaussians_decoders/off_the_grid_decoder.py"
click node_decoder_layers "https://github.com/offthegridgs/offthegrid/blob/main/src/models/gaussians_decoders/layers.py"
click node_gaussian_ops "https://github.com/offthegridgs/offthegrid/blob/main/src/utils/gaussians_utils.py"
click node_trajectory "https://github.com/offthegridgs/offthegrid/blob/main/src/utils/trajectory_utils.py"
click node_colmap_export "https://github.com/offthegridgs/offthegrid/blob/main/src/utils/colmap_utils.py"
click node_mesh_export "https://github.com/offthegridgs/offthegrid/blob/main/src/utils/mesh_utils.py"
click node_visual_outputs "https://github.com/offthegridgs/offthegrid/blob/main/src/utils/os_utils.py"
click node_training_entry "https://github.com/offthegridgs/offthegrid/blob/main/train.py"
click node_decoder_training "https://github.com/offthegridgs/offthegrid/blob/main/train_decoder_only.py"
click node_multigpu_training "https://github.com/offthegridgs/offthegrid/blob/main/train_multigpu.py"
click node_training_data "https://github.com/offthegridgs/offthegrid/blob/main/src/datasets/multires_training_datasets.py"
click node_multigpu_data "https://github.com/offthegridgs/offthegrid/blob/main/src/datasets/multigpu_training_dataset.py"
click node_charge_data "https://github.com/offthegridgs/offthegrid/blob/main/src/datasets/Charge_dataset.py"
click node_scrream_data "https://github.com/offthegridgs/offthegrid/blob/main/src/datasets/scrream_dataset.py"
click node_evaluation_entry "https://github.com/offthegridgs/offthegrid/blob/main/evaluation.py"
click node_baseline "https://github.com/offthegridgs/offthegrid/blob/main/src/models/baselines.py"
click node_eval_metrics "https://github.com/offthegridgs/offthegrid/blob/main/src/utils/metrics_utils.py"
click node_eval_helpers "https://github.com/offthegridgs/offthegrid/blob/main/src/utils/eval_utils.py"
click node_alignment "https://github.com/offthegridgs/offthegrid/blob/main/src/utils/alignment_utils.py"
click node_geometry_ops "https://github.com/offthegridgs/offthegrid/blob/main/src/utils/geometry_utils.py"
click node_losses "https://github.com/offthegridgs/offthegrid/blob/main/src/utils/loss_utils.py"
click node_adaptive_density "https://github.com/offthegridgs/offthegrid/blob/main/src/utils/adaptive_density_utils.py"

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_inference_entry,node_trajectory,node_colmap_export,node_mesh_export,node_visual_outputs,node_user toneBlue
class node_otg_model,node_vggt_encoder,node_da3_encoder,node_omega_encoder,node_gaussian_decoder,node_decoder_layers,node_baseline toneAmber
class node_image_dataset,node_image_loading,node_training_data,node_multigpu_data,node_charge_data,node_scrream_data toneMint
class node_training_entry,node_decoder_training,node_multigpu_training,node_evaluation_entry toneRose
class node_gaussian_ops,node_eval_metrics,node_eval_helpers,node_alignment,node_geometry_ops,node_losses,node_adaptive_density toneIndigo
```

## Components

### Inference and exports

- [Simple inference](https://github.com/offthegridgs/offthegrid/blob/main/simple_inference.py): `simple_inference.py`
- [Trajectory generation](https://github.com/offthegridgs/offthegrid/blob/main/src/utils/trajectory_utils.py): `src/utils/trajectory_utils.py`
- [COLMAP export](https://github.com/offthegridgs/offthegrid/blob/main/src/utils/colmap_utils.py): `src/utils/colmap_utils.py`
- [Mesh export](https://github.com/offthegridgs/offthegrid/blob/main/src/utils/mesh_utils.py): `src/utils/mesh_utils.py`
- [Visualization and video](https://github.com/offthegridgs/offthegrid/blob/main/src/utils/os_utils.py): `src/utils/os_utils.py`

### Reconstruction model

- [Off The Grid model](https://github.com/offthegridgs/offthegrid/blob/main/src/models/off_the_grid.py): `src/models/off_the_grid.py`
- [VGGT encoder](https://github.com/offthegridgs/offthegrid/blob/main/src/models/geometry_encoders/vggt_encoder.py): `src/models/geometry_encoders/vggt_encoder.py`
- [DepthAnything3 encoder](https://github.com/offthegridgs/offthegrid/blob/main/src/models/geometry_encoders/depthanything3_encoder.py): `src/models/geometry_encoders/depthanything3_encoder.py`
- [VGGT Omega encoder](https://github.com/offthegridgs/offthegrid/blob/main/src/models/geometry_encoders/vggt_omega_encoder.py): `src/models/geometry_encoders/vggt_omega_encoder.py`
- [Gaussian decoder](https://github.com/offthegridgs/offthegrid/blob/main/src/models/gaussians_decoders/off_the_grid_decoder.py): `src/models/gaussians_decoders/off_the_grid_decoder.py`
- [Decoder layers](https://github.com/offthegridgs/offthegrid/blob/main/src/models/gaussians_decoders/layers.py): `src/models/gaussians_decoders/layers.py`
- [DA3 Gaussian baseline](https://github.com/offthegridgs/offthegrid/blob/main/src/models/baselines.py): `src/models/baselines.py`

### Datasets and loading

- [Inference image dataset](https://github.com/offthegridgs/offthegrid/blob/main/src/datasets/simple_inference_dataset.py): `src/datasets/simple_inference_dataset.py`
- [Image preprocessing](https://github.com/offthegridgs/offthegrid/blob/main/src/utils/load_utils.py): `src/utils/load_utils.py`
- [Multi-resolution training data](https://github.com/offthegridgs/offthegrid/blob/main/src/datasets/multires_training_datasets.py): `src/datasets/multires_training_datasets.py`
- [Multi-GPU training data](https://github.com/offthegridgs/offthegrid/blob/main/src/datasets/multigpu_training_dataset.py): `src/datasets/multigpu_training_dataset.py`
- [Charge benchmark dataset](https://github.com/offthegridgs/offthegrid/blob/main/src/datasets/Charge_dataset.py): `src/datasets/Charge_dataset.py`
- [SCRREAM benchmark dataset](https://github.com/offthegridgs/offthegrid/blob/main/src/datasets/scrream_dataset.py): `src/datasets/scrream_dataset.py`

### Training and evaluation

- [Training entry points](https://github.com/offthegridgs/offthegrid/blob/main/train.py): `train.py`
- [Decoder-only training](https://github.com/offthegridgs/offthegrid/blob/main/train_decoder_only.py): `train_decoder_only.py`
- [Multi-GPU training](https://github.com/offthegridgs/offthegrid/blob/main/train_multigpu.py): `train_multigpu.py`
- [Benchmark evaluation](https://github.com/offthegridgs/offthegrid/blob/main/evaluation.py): `evaluation.py`

### Geometry and metrics

- [Gaussian rendering and utilities](https://github.com/offthegridgs/offthegrid/blob/main/src/utils/gaussians_utils.py): `src/utils/gaussians_utils.py`
- [Evaluation metrics](https://github.com/offthegridgs/offthegrid/blob/main/src/utils/metrics_utils.py): `src/utils/metrics_utils.py`
- [Evaluation helpers](https://github.com/offthegridgs/offthegrid/blob/main/src/utils/eval_utils.py): `src/utils/eval_utils.py`
- [Camera alignment](https://github.com/offthegridgs/offthegrid/blob/main/src/utils/alignment_utils.py): `src/utils/alignment_utils.py`
- [Camera and depth geometry](https://github.com/offthegridgs/offthegrid/blob/main/src/utils/geometry_utils.py): `src/utils/geometry_utils.py`
- [Training losses](https://github.com/offthegridgs/offthegrid/blob/main/src/utils/loss_utils.py): `src/utils/loss_utils.py`
- [Adaptive density](https://github.com/offthegridgs/offthegrid/blob/main/src/utils/adaptive_density_utils.py): `src/utils/adaptive_density_utils.py`

### Other components

- **Image-sequence user**

## Connections

- Image-sequence user → Simple inference: provides images (evidence: `README.md`)
- Simple inference → Inference image dataset: loads sequence (evidence: `simple_inference.py`)
- Inference image dataset → Image preprocessing: preprocesses images (evidence: `src/datasets/simple_inference_dataset.py`)
- Simple inference → Off The Grid model: runs inference (evidence: `simple_inference.py`)
- Off The Grid model → VGGT encoder: uses encoder (evidence: `src/models/off_the_grid.py`)
- Off The Grid model → DepthAnything3 encoder: uses encoder (evidence: `src/models/off_the_grid.py`)
- Off The Grid model → VGGT Omega encoder: supports encoder (evidence: `src/models/off_the_grid.py`)
- Off The Grid model → Gaussian decoder: decodes primitives (evidence: `src/models/off_the_grid.py`)
- Gaussian decoder → Decoder layers: uses layers (evidence: `src/models/gaussians_decoders/off_the_grid_decoder.py`)
- Off The Grid model → Gaussian rendering and utilities: renders Gaussians (evidence: `src/models/off_the_grid.py`)
- Simple inference → Trajectory generation: generates views (evidence: `simple_inference.py`)
- Simple inference → COLMAP export: exports cameras (evidence: `simple_inference.py`)
- Simple inference → Mesh export: exports mesh (evidence: `simple_inference.py`)
- Simple inference → Visualization and video: saves outputs (evidence: `simple_inference.py`)
- Simple inference → Adaptive density: visualizes density (evidence: `README.md`)
- Training entry points → Off The Grid model: trains model (evidence: `train.py`)
- Decoder-only training → Off The Grid model: trains decoder (evidence: `train_decoder_only.py`)
- Multi-GPU training → Off The Grid model: trains model (evidence: `train_multigpu.py`)
- Training entry points → Multi-resolution training data: loads training data (evidence: `train.py`)
- Decoder-only training → Multi-resolution training data: loads training data (evidence: `train_decoder_only.py`)
- Multi-GPU training → Multi-GPU training data: loads training data (evidence: `train_multigpu.py`)
- Training entry points → Charge benchmark dataset: uses dataset (evidence: `train.py`)
- Training entry points → SCRREAM benchmark dataset: uses dataset (evidence: `train.py`)
- Benchmark evaluation → Off The Grid model: evaluates model (evidence: `evaluation.py`)
- Benchmark evaluation → DA3 Gaussian baseline: evaluates baseline (evidence: `evaluation.py`)
- Benchmark evaluation → Charge benchmark dataset: loads benchmark (evidence: `evaluation.py`)
- Benchmark evaluation → SCRREAM benchmark dataset: loads benchmark (evidence: `evaluation.py`)
- Benchmark evaluation → Evaluation metrics: computes metrics (evidence: `evaluation.py`)
- Benchmark evaluation → Evaluation helpers: computes evaluation (evidence: `evaluation.py`)
- Benchmark evaluation → Camera alignment: aligns cameras (evidence: `evaluation.py`)
- Off The Grid model → Training losses: computes losses (evidence: `src/models/off_the_grid.py`)
- Off The Grid model → Camera and depth geometry: uses geometry (evidence: `src/models/off_the_grid.py`)
- DA3 Gaussian baseline → DepthAnything3 encoder: uses encoder (evidence: `src/models/baselines.py`)
