# faisalshahbaz/gaussian-slam architecture

> Architecture diagram of the GitHub repository faisalshahbaz/gaussian-slam, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/faisalshahbaz/gaussian-slam
- Repository: https://github.com/faisalshahbaz/gaussian-slam

## Overview

##### Project Type and Purpose
- This is a specialized SLAM (Simultaneous Localization and Mapping) system that uses “Gaussian Splatting” to achieve photo-realistic dense scene reconstruction. The purpose is to process input data from various datasets (e.g., Replica, TUM_RGBD, ScanNet, ScanNet++) and produce both real-time SLAM outputs and quantitative evaluations (trajectory, mesh reconstruction, merged maps).
- The README clarifies setup, data downloading, and running the pipeline, while the file structure shows separate folders for configurations, scripts, main execution scripts (run_slam.py, run_evaluation.py), and clearly organized modules inside the src directory.

##### Analyzing the File Structure to Identify Architectural Components
- Entry Points:
- run_slam.py – launches the SLAM pipeline.
- run_evaluation.py – triggers evaluation processes.
- Configurations:
- The configs directory contains subdirectories (Replica, ScanNet, TUM_RGBD, scannetpp) where configuration files define dataset-specific parameters and settings.
- Core Processing Modules (inside src/entities):
- Gaussian Model & SLAM: Modules such as gaussian_model.py and gaussian_slam.py are likely to set up and run the Gaussian Splatting algorithm for mapping.
- Tracker & Mapper: tracker.py, mapper.py, and visual_odometer.py represent the visual tracking and odometry computations needed for SLAM.
- Data and Loss Handling: datasets.py, losses.py, and arguments.py ensure proper data management and loss computation.
- Logging: logger.py – for tracking runtime information.
- Evaluation Subsystem (inside src/evaluation):
- Evaluator and specific evaluators (evaluate_merged_map, evaluate_reconstruction, evaluate_trajectory) which assess the performance of the SLAM outputs.
- Utility Functions (inside src/utils):
- Common functionalities supporting I/O operations, visualization (vis_utils.py), and specific utilities for Gaussian models, mapping, and tracking.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Entry & Config group
    subgraph "Entry & Config"
        Entry1["run_slam.py"]:::entry
        Entry2["run_evaluation.py"]:::entry
        Config["Dataset Configs"]:::config
    end

    Entry1 -->|"starts"| Config
    Entry2 -->|"starts"| Config

    %% Data & Preprocessing group
    subgraph "Data & Preprocessing"
        Datasets["Datasets"]:::core
        Arguments["Arguments"]:::core
        DataMerge["Data Merge"]:::core
        Loss["Loss Computation"]:::core
    end

    Config --> Datasets
    Config --> Arguments
    Datasets --> DataMerge
    Arguments --> DataMerge
    DataMerge --> Loss

    %% Core SLAM Pipeline group
    subgraph "Core SLAM Pipeline"
        Tracker["Tracker Module"]:::core
        Mapper["Mapper Module"]:::core
        Visual["Visual Odometry"]:::core
        GaussianModel["Gaussian Model"]:::core
        GaussianSlam["Gaussian SLAM"]:::core
        Logger["Logger"]:::entry
    end

    Loss --> Tracker
    Tracker --> Mapper
    Tracker --> Visual
    Mapper --> GaussianModel
    Visual --> GaussianModel
    GaussianModel --> GaussianSlam
    GaussianSlam --> Logger

    %% Evaluation group
    subgraph "Evaluation"
        Eval["Evaluation Subsystem"]:::evaluation
    end

    Logger --> Eval

    %% Utilities group
    subgraph "Utilities"
        Utils["Utility Functions"]:::utils
    end

    Datasets --> Utils
    Tracker --> Utils
    Mapper --> Utils
    GaussianSlam --> Utils
    Eval --> Utils

    %% Click Events
    click Entry1 "https://github.com/faisalshahbaz/gaussian-slam/blob/main/run_slam.py"
    click Entry2 "https://github.com/faisalshahbaz/gaussian-slam/blob/main/run_evaluation.py"
    click Config "https://github.com/faisalshahbaz/gaussian-slam/tree/main/configs/"
    click Datasets "https://github.com/faisalshahbaz/gaussian-slam/blob/main/src/entities/datasets.py"
    click Arguments "https://github.com/faisalshahbaz/gaussian-slam/blob/main/src/entities/arguments.py"
    click Loss "https://github.com/faisalshahbaz/gaussian-slam/blob/main/src/entities/losses.py"
    click Tracker "https://github.com/faisalshahbaz/gaussian-slam/blob/main/src/entities/tracker.py"
    click Mapper "https://github.com/faisalshahbaz/gaussian-slam/blob/main/src/entities/mapper.py"
    click Visual "https://github.com/faisalshahbaz/gaussian-slam/blob/main/src/entities/visual_odometer.py"
    click GaussianModel "https://github.com/faisalshahbaz/gaussian-slam/blob/main/src/entities/gaussian_model.py"
    click GaussianSlam "https://github.com/faisalshahbaz/gaussian-slam/blob/main/src/entities/gaussian_slam.py"
    click Logger "https://github.com/faisalshahbaz/gaussian-slam/blob/main/src/entities/logger.py"
    click Eval "https://github.com/faisalshahbaz/gaussian-slam/tree/main/src/evaluation/"
    click Utils "https://github.com/faisalshahbaz/gaussian-slam/tree/main/src/utils/"

    %% Styles
    classDef entry fill:#D3D3D3,stroke:#000,stroke-width:1px;
    classDef config fill:#D3D3D3,stroke:#000,stroke-width:1px;
    classDef core fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef evaluation fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef utils fill:#FFA500,stroke:#000,stroke-width:1px;
```
