# davwed0/senior-design-project architecture

> Architecture diagram of the GitHub repository davwed0/senior-design-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/davwed0/senior-design-project
- Repository: https://github.com/davwed0/senior-design-project

## Overview

##### Main Components
- Pipeline Orchestrator: Represent the main controller (run_pipeline.sh) that initiates the entire process.
- Input Datasets: Include a component that depicts datasets (with folders for <cluster_name> and <base_cluster>, along with files like mask.pt, PNG/JPG images, cameras.bin, images.bin, points3D.bin, database.db).
- Environment & Dependencies: Note the Linux environment, Conda environments (“r3dg” and “sugar”), and a CUDA-compatible GPU.
- R3DG Submodule: Show the Relightable3DGaussian submodule, which carries out two rounds of training (initial training and second training).
- NEILF Training: Illustrate this as a step between R3DG training runs to add relighting support.
- Output Generation: Include steps/components for Mesh and Texture Extraction and the final outputs (showing separate folders under Relightable3DGaussian/output and SuGaR/output).

##### Detail the Relationships and Interactions
- How the pipeline first passes data to R3DG for initial training.
- Direct the flow from NEILF training into the SuGaR component, emphasizing the refinement interaction.
- Finally, demonstrate paths leading to the second round of R3DG training and NEILF training to integrate the refined results, and then onward to Mesh and Texture Extraction.
- Finally, point out that all these components ultimately produce output files stored in the output/ hierarchy, mapping both early-phase (point clouds, json configurations) and final mesh outputs.

##### Architectural Patterns
- Modularity: The use of submodules (Relightable3DGaussian and SuGaR) suggests a modular design where each component can be developed, tested, or replaced independently.
- Sequential/Pipelined Processing: Indicate that the pipeline has clear sequential stages (initial training, refinement, re-training, and extraction) with feedback loops.

##### Incorporate Technologies & Conventions
- Mention the use of shell scripts (run_pipeline.sh) as the orchestrator.
- That the pipeline leverages CUDA for GPU support.
- Reference the external repositories (cloned as submodules) and their roles in the overall processing.

##### Specific Elements
- Labeled Blocks/Nodes: Represent each major module or processing stage.
- Environment Boundaries: Optionally add a note or a symbol to indicate the different Conda environments and the GPU dependency.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Environmental Setup
    subgraph "Environmental Setup"
        ENV1["Linux Environment"]:::env
        ENV2["Conda Environment: r3dg"]:::env
        ENV3["Conda Environment: sugar"]:::env
        ENV4["CUDA GPU Support"]:::env
    end

    %% Input Data and Resources
    subgraph "Input Data and Resources"
        DS["Input Datasets<br/>(<cluster_name>, <base_cluster>, mask.pt, PNG/JPG images,<br/>cameras.bin, images.bin, points3D.bin, database.db)"]:::dataset
    end

    %% Pipeline Orchestration
    subgraph "Pipeline Orchestration"
        ORCH["Pipeline Orchestrator (run_pipeline.sh)"]:::orchestrator
    end

    %% Processing Pipeline
    subgraph "Processing Pipeline"
        R3DG1["R3DG (Initial Training)"]:::submodule
        NEILF1["NEILF Training (Relighting Support)"]:::processing
        SUGAR["SuGaR (Refinement)"]:::submodule
        R3DG2["R3DG (Second Training)"]:::submodule
        NEILF2["NEILF Training (Second Relighting)"]:::processing
        MESH["Mesh & Texture Extraction"]:::processing
    end

    %% Output Generation
    subgraph "Output Generation"
        OUT["Final Outputs<br/>(Relightable3DGaussian/output, SuGaR/output)"]:::output
    end

    %% Data Flow Connections
    DS -->|"ingests"| ORCH
    ENV1 --> ORCH
    ENV2 --> ORCH
    ENV3 --> ORCH
    ENV4 --> ORCH

    ORCH -->|"initiates"| R3DG1
    R3DG1 -->|"produces model"| NEILF1
    NEILF1 -->|"adds relighting"| SUGAR
    SUGAR -->|"refined output"| R3DG2
    R3DG2 -->|"integrates"| NEILF2
    NEILF2 -->|"prepares extraction"| MESH
    MESH -->|"generates"| OUT

    %% Click Events
    click ORCH "https://github.com/davwed0/senior-design-project/blob/main/run_pipeline.sh"
    click R3DG1 "https://github.com/davwed0/senior-design-project/tree/main/Relightable3DGaussian"
    click SUGAR "https://github.com/davwed0/senior-design-project/tree/main/SuGaR"

    %% Styles
    classDef env fill:#b3cde0,stroke:#6497b1,stroke-width:2px;
    classDef dataset fill:#ccebc5,stroke:#74a57f,stroke-width:2px;
    classDef orchestrator fill:#decbe4,stroke:#b2919f,stroke-width:2px;
    classDef submodule fill:#fefbd8,stroke:#f3c623,stroke-width:2px;
    classDef processing fill:#fff2cc,stroke:#d6a11c,stroke-width:2px;
    classDef output fill:#ffd1dc,stroke:#ff69b4,stroke-width:2px;
```
