# zju3dv/log architecture

> Architecture diagram of the GitHub repository zju3dv/log, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zju3dv/log
- Repository: https://github.com/zju3dv/log

## Overview

##### Main Components Identification

The system can be broken down into these major components:

a) Data Processing Pipeline
- COLMAP integration
- Dataset handling
- Camera calibration

b) Core Model Components
- Gaussian Processing
- Level of Gaussian implementation
- Rendering system

c) Training and Optimization
- Model training
- Sparse optimization
- Correction mechanisms

**Top Level:**
**[Input Data] → [Processing Pipeline] → [Core Model] → [Rendering Engine] → [Output Visualization]**

**Second Level (expand each component):**

**Input Data:**
- COLMAP data
- Camera parameters
- Image datasets

**Processing Pipeline:**
- Dataset module (/LoG/dataset/)
- Camera calibration (/apps/calibration/)
- Data preprocessing

**Core Model:**
- Base Gaussian implementation
- Level of Gaussian system
- Geometry processing
- Sparse optimization

**Rendering Engine:**
- CUDA-based radius computation
- Real-time renderer
- Loss computation

**Output:**
- Real-time visualization
- Interpolation results
- Performance metrics

##### Technical Details to Highlight

- The RTX 4090 GPU utilization
- Integration with gaussian-splatting
- Real-time rendering capabilities
- Training pipeline flow
- Dataset preprocessing steps

##### Implementation Notes

Clear separation between:
- Model definition (/LoG/model/)
- Rendering pipeline (/LoG/render/)
- Dataset handling (/LoG/dataset/)
- Utility functions (/LoG/utils/)

##### External Integrations

Connections with:
- COLMAP
- EasyVolcap visualization tool
- PyTorch framework
- CUDA runtime

Remember to emphasize the system's unique capability to handle urban-scale models and real-time rendering aspects, as these are key differentiating features of the LoG project.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Legend
        A1[Processing Component]:::processing
        A2[Core Model Component]:::core
        A3[Rendering Component]:::rendering
        A4[Training Component]:::training
        A5[Utility Component]:::utility
    end

    subgraph "Input Processing"
        COLMAP["COLMAP Integration"]:::processing
        Dataset["Dataset Handler"]:::processing
        Camera["Camera Calibration"]:::processing
    end

    subgraph "Core Model"
        BaseGaussian["Base Gaussian"]:::core
        LoG["Level of Gaussian"]:::core
        Geometry["Geometry Processing"]:::core
        Corrector["Model Corrector"]:::core
        Splitter["Model Splitter"]:::core
        Counter["Model Counter"]:::core
    end

    subgraph "Rendering System"
        Renderer["Real-time Renderer"]:::rendering
        CUDARadius["CUDA Radius Computation"]:::rendering
        LossComp["Loss Computation"]:::rendering
    end

    subgraph "Training & Optimization"
        SparseOpt["Sparse Optimizer"]:::training
        Trainer["Training System"]:::training
        TrainApp["Training Application"]:::training
    end

    subgraph "Visualization & Utils"
        GUI["GUI Interface"]:::utility
        Config["Configuration"]:::utility
        Metrics["Metrics"]:::utility
        Recorder["Recorder"]:::utility
        EasyVolcap["EasyVolcap Utils"]:::utility
    end

    COLMAP --> Dataset
    Dataset --> Camera
    Camera --> BaseGaussian
    BaseGaussian --> LoG
    LoG --> Geometry
    Geometry --> Corrector
    Corrector --> Splitter
    Splitter --> Counter

    Counter --> Renderer
    Renderer --> CUDARadius
    CUDARadius --> LossComp

    LossComp --> SparseOpt
    SparseOpt --> Trainer
    Trainer --> TrainApp

    Renderer --> GUI
    Config --> Trainer
    Metrics --> Recorder
    GUI --> EasyVolcap

    %% Click events for component mapping
    click COLMAP "https://github.com/zju3dv/LoG/blob/main/LoG/dataset/colmap.py"
    click Dataset "https://github.com/zju3dv/LoG/blob/main/LoG/dataset/base.py"
    click Camera "https://github.com/zju3dv/LoG/blob/main/LoG/dataset/camera_utils.py"
    click BaseGaussian "https://github.com/zju3dv/LoG/blob/main/LoG/model/base_gaussian.py"
    click LoG "https://github.com/zju3dv/LoG/blob/main/LoG/model/level_of_gaussian.py"
    click Geometry "https://github.com/zju3dv/LoG/blob/main/LoG/model/geometry.py"
    click Renderer "https://github.com/zju3dv/LoG/blob/main/LoG/render/renderer.py"
    click CUDARadius "https://github.com/zju3dv/LoG/blob/main/LoG/cuda/compute_radius.py"
    click LossComp "https://github.com/zju3dv/LoG/blob/main/LoG/render/loss.py"
    click SparseOpt "https://github.com/zju3dv/LoG/blob/main/LoG/model/sparse_optimizer.py"
    click Trainer "https://github.com/zju3dv/LoG/blob/main/LoG/utils/trainer.py"
    click TrainApp "https://github.com/zju3dv/LoG/blob/main/apps/train.py"
    click Corrector "https://github.com/zju3dv/LoG/blob/main/LoG/model/corrector.py"
    click Splitter "https://github.com/zju3dv/LoG/blob/main/LoG/model/splitter.py"
    click Counter "https://github.com/zju3dv/LoG/blob/main/LoG/model/counter.py"
    click Config "https://github.com/zju3dv/LoG/blob/main/LoG/utils/config.py"
    click Metrics "https://github.com/zju3dv/LoG/blob/main/LoG/utils/metric.py"
    click Recorder "https://github.com/zju3dv/LoG/blob/main/LoG/utils/recorder.py"
    click GUI "https://github.com/zju3dv/LoG/blob/main/apps/gui.py"
    click EasyVolcap "https://github.com/zju3dv/LoG/blob/main/LoG/utils/easyvolcap_utils.py"

    classDef processing fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef rendering fill:#e67e22,stroke:#d35400,color:white
    classDef training fill:#9b59b6,stroke:#8e44ad,color:white
    classDef utility fill:#95a5a6,stroke:#7f8c8d,color:white
```
