# cvlab-uos/viewsplat architecture

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

- Interactive diagram: https://gitdiagram.com/cvlab-uos/viewsplat
- Repository: https://github.com/cvlab-uos/viewsplat

## Overview

ViewSplat is a feed-forward novel-view synthesis system that predicts and refines 3D Gaussian attributes for a requested camera pose. The principal workflow is configured in `src/main.py`: it constructs the model and data module, then trains or tests them; the model wrapper coordinates encoding, rendering, and losses. Separate capabilities include pose evaluation and in-the-wild point-cloud/video visualization. Edges are limited to relationships supported by the README, excerpts, or SOURCE INDEX; unsampled subsystem links are omitted where callers are not evidenced.

Main entry points: [`src/paper/validate_in_the_wild.py`](https://github.com/cvlab-uos/viewsplat/blob/main/src/paper/validate_in_the_wild.py) (Wild-Scene Validation), [`src/model/encoder/encoder_spf_viewsplat.py`](https://github.com/cvlab-uos/viewsplat/blob/main/src/model/encoder/encoder_spf_viewsplat.py) (ViewSplat Encoder), [`src/main.py`](https://github.com/cvlab-uos/viewsplat/blob/main/src/main.py) (Train / Test), [`src/model/model_wrapper.py`](https://github.com/cvlab-uos/viewsplat/blob/main/src/model/model_wrapper.py) (Model Wrapper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Training Workflow"]
  node_main["Train / Test<br/>[main.py]"]
  node_config["Configuration<br/>[config.py]"]
  node_data_module["Data Loading<br/>[data_module.py]"]
  node_re10k["RE10K Dataset<br/>[dataset_re10k.py]"]
  node_samplers["View Sampling"]
  node_wrapper["Model Wrapper<br/>[model_wrapper.py]"]
  node_losses["Training Losses<br/>[loss_ssim.py]"]
end

subgraph group_representation["Scene Reconstruction"]
  node_encoder["ViewSplat Encoder"]
  node_backbone["Feature Backbones"]
  node_gaussian_adapter["Gaussian Adapter"]
  node_geometry["Camera Geometry<br/>[projection.py]"]
  node_decoder["Gaussian Renderer"]
end

subgraph group_evaluation["Evaluation"]
  node_pose_entry["Pose Evaluation Entry<br/>[eval_pose.py]"]
  node_pose_eval["Pose Evaluator<br/>[pose_evaluator.py]"]
  node_metrics["Image Metrics<br/>[metrics.py]"]
  node_index_generator["Evaluation Indices"]
end

subgraph group_visualization["Visualization"]
  node_wild["Wild-Scene Validation"]
  node_ply["Point-Cloud Export<br/>[ply_export.py]"]
  node_visualization["Result Visualization<br/>[layout.py]"]
  node_image_io["Image I/O<br/>[image_io.py]"]
end

node_user(("Researcher"))

node_user -->|"runs"| node_main
node_main -->|"loads configuration"| node_config
node_main -->|"constructs data"| node_data_module
node_main -->|"trains or tests"| node_wrapper
node_data_module -->|"gets datasets"| node_re10k
node_data_module -.->|"configures sampling"| node_samplers
node_wrapper -->|"runs encoder"| node_encoder
node_wrapper -.->|"renders predictions"| node_decoder
node_wrapper -->|"computes losses"| node_losses
node_encoder -->|"extracts features"| node_backbone
node_encoder -->|"adapts Gaussians"| node_gaussian_adapter
node_encoder -->|"projects geometry"| node_geometry
node_decoder -->|"uses projection"| node_geometry
node_pose_entry -->|"runs evaluation"| node_pose_eval
node_pose_entry -->|"loads evaluation data"| node_data_module
node_pose_eval -->|"uses metrics"| node_metrics
node_user -->|"evaluates poses"| node_pose_entry
node_index_generator -->|"computes geometry"| node_geometry
node_index_generator -->|"lays out previews"| node_visualization
node_wild -->|"builds reconstruction"| node_encoder
node_wild -->|"renders views"| node_decoder
node_wild -->|"exports point cloud"| node_ply
node_wild -->|"writes images"| node_image_io
node_wild -->|"creates visual outputs"| node_visualization

click node_main "https://github.com/cvlab-uos/viewsplat/blob/main/src/main.py"
click node_config "https://github.com/cvlab-uos/viewsplat/blob/main/src/config.py"
click node_data_module "https://github.com/cvlab-uos/viewsplat/blob/main/src/dataset/data_module.py"
click node_re10k "https://github.com/cvlab-uos/viewsplat/blob/main/src/dataset/dataset_re10k.py"
click node_samplers "https://github.com/cvlab-uos/viewsplat/blob/main/src/dataset/view_sampler/view_sampler_bounded.py"
click node_wrapper "https://github.com/cvlab-uos/viewsplat/blob/main/src/model/model_wrapper.py"
click node_encoder "https://github.com/cvlab-uos/viewsplat/blob/main/src/model/encoder/encoder_spf_viewsplat.py"
click node_backbone "https://github.com/cvlab-uos/viewsplat/tree/main/src/model/encoder/backbone"
click node_gaussian_adapter "https://github.com/cvlab-uos/viewsplat/blob/main/src/model/encoder/common/gaussian_adapter.py"
click node_geometry "https://github.com/cvlab-uos/viewsplat/blob/main/src/geometry/projection.py"
click node_decoder "https://github.com/cvlab-uos/viewsplat/blob/main/src/model/decoder/decoder_splatting_cuda.py"
click node_losses "https://github.com/cvlab-uos/viewsplat/blob/main/src/loss/loss_ssim.py"
click node_pose_entry "https://github.com/cvlab-uos/viewsplat/blob/main/src/eval_pose.py"
click node_pose_eval "https://github.com/cvlab-uos/viewsplat/blob/main/src/evaluation/pose_evaluator.py"
click node_metrics "https://github.com/cvlab-uos/viewsplat/blob/main/src/evaluation/metrics.py"
click node_index_generator "https://github.com/cvlab-uos/viewsplat/blob/main/src/evaluation/evaluation_index_generator.py"
click node_wild "https://github.com/cvlab-uos/viewsplat/blob/main/src/paper/validate_in_the_wild.py"
click node_ply "https://github.com/cvlab-uos/viewsplat/blob/main/src/model/ply_export.py"
click node_visualization "https://github.com/cvlab-uos/viewsplat/blob/main/src/visualization/layout.py"
click node_image_io "https://github.com/cvlab-uos/viewsplat/blob/main/src/misc/image_io.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_main,node_config,node_data_module,node_re10k,node_samplers,node_wrapper,node_losses toneBlue
class node_encoder,node_backbone,node_gaussian_adapter,node_geometry,node_decoder toneAmber
class node_pose_entry,node_pose_eval,node_metrics,node_index_generator toneMint
class node_wild,node_ply,node_visualization,node_image_io toneRose
class node_user toneIndigo
```

## Components

### Training Workflow

- [Train / Test](https://github.com/cvlab-uos/viewsplat/blob/main/src/main.py): `src/main.py`
- [Configuration](https://github.com/cvlab-uos/viewsplat/blob/main/src/config.py): `src/config.py`
- [Data Loading](https://github.com/cvlab-uos/viewsplat/blob/main/src/dataset/data_module.py): `src/dataset/data_module.py`
- [RE10K Dataset](https://github.com/cvlab-uos/viewsplat/blob/main/src/dataset/dataset_re10k.py): `src/dataset/dataset_re10k.py`
- [View Sampling](https://github.com/cvlab-uos/viewsplat/blob/main/src/dataset/view_sampler/view_sampler_bounded.py): `src/dataset/view_sampler/view_sampler_bounded.py`
- [Model Wrapper](https://github.com/cvlab-uos/viewsplat/blob/main/src/model/model_wrapper.py): `src/model/model_wrapper.py`
- [Training Losses](https://github.com/cvlab-uos/viewsplat/blob/main/src/loss/loss_ssim.py): `src/loss/loss_ssim.py`

### Scene Reconstruction

- [ViewSplat Encoder](https://github.com/cvlab-uos/viewsplat/blob/main/src/model/encoder/encoder_spf_viewsplat.py): `src/model/encoder/encoder_spf_viewsplat.py`
- [Feature Backbones](https://github.com/cvlab-uos/viewsplat/tree/main/src/model/encoder/backbone): `src/model/encoder/backbone`
- [Gaussian Adapter](https://github.com/cvlab-uos/viewsplat/blob/main/src/model/encoder/common/gaussian_adapter.py): `src/model/encoder/common/gaussian_adapter.py`
- [Camera Geometry](https://github.com/cvlab-uos/viewsplat/blob/main/src/geometry/projection.py): `src/geometry/projection.py`
- [Gaussian Renderer](https://github.com/cvlab-uos/viewsplat/blob/main/src/model/decoder/decoder_splatting_cuda.py): `src/model/decoder/decoder_splatting_cuda.py`

### Evaluation

- [Pose Evaluation Entry](https://github.com/cvlab-uos/viewsplat/blob/main/src/eval_pose.py): `src/eval_pose.py`
- [Pose Evaluator](https://github.com/cvlab-uos/viewsplat/blob/main/src/evaluation/pose_evaluator.py): `src/evaluation/pose_evaluator.py`
- [Image Metrics](https://github.com/cvlab-uos/viewsplat/blob/main/src/evaluation/metrics.py): `src/evaluation/metrics.py`
- [Evaluation Indices](https://github.com/cvlab-uos/viewsplat/blob/main/src/evaluation/evaluation_index_generator.py): `src/evaluation/evaluation_index_generator.py`

### Visualization

- [Wild-Scene Validation](https://github.com/cvlab-uos/viewsplat/blob/main/src/paper/validate_in_the_wild.py): `src/paper/validate_in_the_wild.py`
- [Point-Cloud Export](https://github.com/cvlab-uos/viewsplat/blob/main/src/model/ply_export.py): `src/model/ply_export.py`
- [Result Visualization](https://github.com/cvlab-uos/viewsplat/blob/main/src/visualization/layout.py): `src/visualization/layout.py`
- [Image I/O](https://github.com/cvlab-uos/viewsplat/blob/main/src/misc/image_io.py): `src/misc/image_io.py`

### Other components

- **Researcher**

## Connections

- Researcher → Train / Test: runs (evidence: `README.md`)
- Train / Test → Configuration: loads configuration (evidence: `src/main.py`)
- Train / Test → Data Loading: constructs data (evidence: `src/main.py`)
- Train / Test → Model Wrapper: trains or tests (evidence: `src/main.py`)
- Data Loading → RE10K Dataset: gets datasets (evidence: `src/dataset/data_module.py`)
- Data Loading → View Sampling: configures sampling
- Model Wrapper → ViewSplat Encoder: runs encoder (evidence: `src/model/model_wrapper.py`)
- Model Wrapper → Gaussian Renderer: renders predictions
- Model Wrapper → Training Losses: computes losses (evidence: `src/model/model_wrapper.py`)
- ViewSplat Encoder → Feature Backbones: extracts features (evidence: `src/model/encoder/encoder_spf_viewsplat.py`)
- ViewSplat Encoder → Gaussian Adapter: adapts Gaussians (evidence: `src/model/encoder/encoder_spf_viewsplat.py`)
- ViewSplat Encoder → Camera Geometry: projects geometry (evidence: `src/model/encoder/encoder_spf_viewsplat.py`)
- Gaussian Renderer → Camera Geometry: uses projection
- Pose Evaluation Entry → Pose Evaluator: runs evaluation (evidence: `src/eval_pose.py`)
- Pose Evaluation Entry → Data Loading: loads evaluation data (evidence: `src/eval_pose.py`)
- Pose Evaluator → Image Metrics: uses metrics (evidence: `src/evaluation/pose_evaluator.py`)
- Researcher → Pose Evaluation Entry: evaluates poses (evidence: `src/eval_pose.py`)
- Evaluation Indices → Camera Geometry: computes geometry (evidence: `src/evaluation/evaluation_index_generator.py`)
- Evaluation Indices → Result Visualization: lays out previews (evidence: `src/evaluation/evaluation_index_generator.py`)
- Wild-Scene Validation → ViewSplat Encoder: builds reconstruction (evidence: `src/paper/validate_in_the_wild.py`)
- Wild-Scene Validation → Gaussian Renderer: renders views (evidence: `src/paper/validate_in_the_wild.py`)
- Wild-Scene Validation → Point-Cloud Export: exports point cloud (evidence: `src/paper/validate_in_the_wild.py`)
- Wild-Scene Validation → Image I/O: writes images (evidence: `src/paper/validate_in_the_wild.py`)
- Wild-Scene Validation → Result Visualization: creates visual outputs (evidence: `src/paper/validate_in_the_wild.py`)
