# bchao1/textured_gaussians architecture

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

- Interactive diagram: https://gitdiagram.com/bchao1/textured_gaussians
- Repository: https://github.com/bchao1/textured_gaussians

## Overview

Textured Gaussians is a PyTorch/GPU library and example workflow for fitting 2DGS scenes, refining them with spatially varying texture and alpha, and rendering the resulting Gaussian scene. The documented path is dataset loading, 2DGS pre-training, then textured refinement; the trainer also computes image-quality metrics. Runtime capabilities include 2DGS/3DGS rasterization, densification strategies, distributed rendering, selective optimization, and PNG splat compression. Training and dataset internals were not excerpted, so those links rely on the README; other links are limited to relationships visible in sampled source or the SOURCE INDEX.

Main entry points: [`examples/simple_trainer_textured_gaussians.py`](https://github.com/bchao1/textured_gaussians/blob/main/examples/simple_trainer_textured_gaussians.py) (Example trainer), [`textured_gaussians/cuda/_wrapper.py`](https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/cuda/_wrapper.py) (CUDA operation wrapper), [`textured_gaussians/rendering.py`](https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/rendering.py) (Rasterization APIs), [`textured_gaussians/strategy/ops.py`](https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/strategy/ops.py) (Gaussian edits)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Training workflow"]
  node_datasets["Dataset loaders"]
  node_trainer["Example trainer"]
  node_metrics["Image metrics"]
end

subgraph group_render["Rendering engine"]
  node_rasterization["Rasterization APIs<br/>[rendering.py]"]
  node_texture_kernels["Textured 2DGS kernels"]
  node_cuda_wrapper["CUDA operation wrapper<br/>[_wrapper.py]"]
  node_cuda_backend["CUDA backend<br/>[_backend.py]"]
  node_torch_impl["PyTorch raster ops<br/>[_torch_impl.py]"]
  node_torch_2dgs["2DGS PyTorch ops"]
end

subgraph group_adapt["Optimization and adaptation"]
  node_default_strategy["Default strategy<br/>[default.py]"]
  node_mcmc_strategy["MCMC strategy<br/>[mcmc.py]"]
  node_strategy_ops["Gaussian edits<br/>[ops.py]"]
  node_relocation["Gaussian relocation<br/>[relocation.py]"]
  node_selective_adam["Selective Adam<br/>[selective_adam.py]"]
end

subgraph group_runtime["Runtime support"]
  node_distributed["Distributed collectives<br/>[distributed.py]"]
end

subgraph group_assets["Splat assets"]
  node_compression["PNG compression<br/>[png_compression.py]"]
  node_sort["Compression sorting<br/>[sort.py]"]
end

node_researcher(("Researcher"))

node_researcher -->|"provides data"| node_datasets
node_datasets -->|"loads scenes"| node_trainer
node_researcher -->|"configures stages"| node_trainer
node_trainer -->|"renders training views"| node_rasterization
node_trainer -.->|"may refine"| node_default_strategy
node_trainer -->|"uses MCMC"| node_mcmc_strategy
node_trainer -->|"computes metrics"| node_metrics
node_rasterization -->|"calls operations"| node_cuda_wrapper
node_rasterization -->|"uses collectives"| node_distributed
node_cuda_wrapper -->|"dispatches kernels"| node_cuda_backend
node_cuda_wrapper -.->|"uses implementations"| node_torch_impl
node_cuda_wrapper -.->|"uses 2DGS ops"| node_torch_2dgs
node_default_strategy -->|"edits Gaussians"| node_strategy_ops
node_mcmc_strategy -->|"edits Gaussians"| node_strategy_ops
node_strategy_ops -->|"relocates splats"| node_relocation
node_relocation -->|"calls operations"| node_cuda_wrapper
node_selective_adam -->|"updates parameters"| node_cuda_wrapper
node_compression -->|"uses sorting"| node_sort

click node_datasets "https://github.com/bchao1/textured_gaussians/tree/main/examples/datasets"
click node_trainer "https://github.com/bchao1/textured_gaussians/blob/main/examples/simple_trainer_textured_gaussians.py"
click node_metrics "https://github.com/bchao1/textured_gaussians/blob/main/examples/simple_trainer_textured_gaussians.py"
click node_rasterization "https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/rendering.py"
click node_texture_kernels "https://github.com/bchao1/textured_gaussians/tree/main/textured_gaussians/cuda/csrc"
click node_cuda_wrapper "https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/cuda/_wrapper.py"
click node_cuda_backend "https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/cuda/_backend.py"
click node_torch_impl "https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/cuda/_torch_impl.py"
click node_torch_2dgs "https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/cuda/_torch_impl_2dgs.py"
click node_default_strategy "https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/strategy/default.py"
click node_mcmc_strategy "https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/strategy/mcmc.py"
click node_strategy_ops "https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/strategy/ops.py"
click node_relocation "https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/relocation.py"
click node_selective_adam "https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/optimizers/selective_adam.py"
click node_distributed "https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/distributed.py"
click node_compression "https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/compression/png_compression.py"
click node_sort "https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/compression/sort.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_datasets,node_trainer,node_metrics toneBlue
class node_rasterization,node_texture_kernels,node_cuda_wrapper,node_cuda_backend,node_torch_impl,node_torch_2dgs toneAmber
class node_default_strategy,node_mcmc_strategy,node_strategy_ops,node_relocation,node_selective_adam toneMint
class node_distributed toneRose
class node_compression,node_sort,node_researcher toneIndigo
```

## Components

### Training workflow

- [Dataset loaders](https://github.com/bchao1/textured_gaussians/tree/main/examples/datasets): `examples/datasets`
- [Example trainer](https://github.com/bchao1/textured_gaussians/blob/main/examples/simple_trainer_textured_gaussians.py): `examples/simple_trainer_textured_gaussians.py`
- [Image metrics](https://github.com/bchao1/textured_gaussians/blob/main/examples/simple_trainer_textured_gaussians.py): `examples/simple_trainer_textured_gaussians.py`

### Rendering engine

- [Rasterization APIs](https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/rendering.py): `textured_gaussians/rendering.py`
- [Textured 2DGS kernels](https://github.com/bchao1/textured_gaussians/tree/main/textured_gaussians/cuda/csrc): `textured_gaussians/cuda/csrc`
- [CUDA operation wrapper](https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/cuda/_wrapper.py): `textured_gaussians/cuda/_wrapper.py`
- [CUDA backend](https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/cuda/_backend.py): `textured_gaussians/cuda/_backend.py`
- [PyTorch raster ops](https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/cuda/_torch_impl.py): `textured_gaussians/cuda/_torch_impl.py`
- [2DGS PyTorch ops](https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/cuda/_torch_impl_2dgs.py): `textured_gaussians/cuda/_torch_impl_2dgs.py`

### Optimization and adaptation

- [Default strategy](https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/strategy/default.py): `textured_gaussians/strategy/default.py`
- [MCMC strategy](https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/strategy/mcmc.py): `textured_gaussians/strategy/mcmc.py`
- [Gaussian edits](https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/strategy/ops.py): `textured_gaussians/strategy/ops.py`
- [Gaussian relocation](https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/relocation.py): `textured_gaussians/relocation.py`
- [Selective Adam](https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/optimizers/selective_adam.py): `textured_gaussians/optimizers/selective_adam.py`

### Runtime support

- [Distributed collectives](https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/distributed.py): `textured_gaussians/distributed.py`

### Splat assets

- [PNG compression](https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/compression/png_compression.py): `textured_gaussians/compression/png_compression.py`
- [Compression sorting](https://github.com/bchao1/textured_gaussians/blob/main/textured_gaussians/compression/sort.py): `textured_gaussians/compression/sort.py`

### Other components

- **Researcher**

## Connections

- Researcher → Dataset loaders: provides data (evidence: `README.md`)
- Dataset loaders → Example trainer: loads scenes (evidence: `README.md`)
- Researcher → Example trainer: configures stages (evidence: `README.md`)
- Example trainer → Rasterization APIs: renders training views (evidence: `README.md`)
- Example trainer → Default strategy: may refine
- Example trainer → MCMC strategy: uses MCMC (evidence: `README.md`)
- Example trainer → Image metrics: computes metrics (evidence: `README.md`)
- Rasterization APIs → CUDA operation wrapper: calls operations (evidence: `textured_gaussians/rendering.py`)
- Rasterization APIs → Distributed collectives: uses collectives (evidence: `textured_gaussians/rendering.py`)
- CUDA operation wrapper → CUDA backend: dispatches kernels (evidence: `textured_gaussians/cuda/_wrapper.py`)
- CUDA operation wrapper → PyTorch raster ops: uses implementations (evidence: `textured_gaussians/cuda/_torch_impl.py`)
- CUDA operation wrapper → 2DGS PyTorch ops: uses 2DGS ops (evidence: `textured_gaussians/cuda/_torch_impl_2dgs.py`)
- Default strategy → Gaussian edits: edits Gaussians (evidence: `textured_gaussians/strategy/default.py`)
- MCMC strategy → Gaussian edits: edits Gaussians (evidence: `textured_gaussians/strategy/mcmc.py`)
- Gaussian edits → Gaussian relocation: relocates splats (evidence: `textured_gaussians/strategy/ops.py`)
- Gaussian relocation → CUDA operation wrapper: calls operations (evidence: `textured_gaussians/relocation.py`)
- Selective Adam → CUDA operation wrapper: updates parameters (evidence: `textured_gaussians/optimizers/selective_adam.py`)
- PNG compression → Compression sorting: uses sorting (evidence: `textured_gaussians/compression/png_compression.py`)
