# harrylal/simulation-of-birds-eye-view-map-generation-from-rgbd-data architecture

> Architecture diagram of the GitHub repository harrylal/simulation-of-birds-eye-view-map-generation-from-rgbd-data, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harrylal/simulation-of-birds-eye-view-map-generation-from-rgbd-data
- Repository: https://github.com/harrylal/simulation-of-birds-eye-view-map-generation-from-rgbd-data

## Overview

##### Main Components
- Data Source/Input Layer:
- KITTI Dataset: Show both LiDAR data and RGB or depth images coming from the raw KITTI files.
- Configuration Module:
- Settings from config/settings.yaml that determine data paths (KITTI data, BiSeNet weights) and calibration details.
- Preprocessing & Calibration:
- Scripts like kitti_calibration.py and kitti_video.py handle sensor synchronization and calibration.
- Utility functions (e.g., utils/lidar.py) process raw LiDAR data.
- Semantic Segmentation Module:
- The BiSeNetv2 model contained in the models/BiSeNetv2 directory, including its training, testing, and demo scripts; it predicts semantic segmentation masks.
- Point Cloud Processing & Fusion:
- The pointpainting.py script is used to project LiDAR points onto the image plane to merge semantic information.
- Grid Map Generation:
- maps.py and main.py are likely central to taking the fused data and generating the bird’s-eye view occupancy grid map.
- Clustering and Tracking Module:
- Implementations such as DBSCAN for clustering (as mentioned in the key features) and temporal tracking (tracking objects over time) may be integrated directly into main.py or through other utility functions.
- Output/Visualization Layer:
- Assets (GIFs in the assets folder) likely show demonstration of the final output, and visualization scripts (like models/BiSeNetv2/visualization.py) could be used to display the segmentation and the BEV map.

##### Relationships & Interactions
- Data Flow:
- Raw data from the KITTI dataset (LiDAR & camera) is read (using settings from config/settings.yaml).
- Preprocessing/calibration modules process and align the sensor data.
- The preprocessed images are fed to the BiSeNetv2 segmentation component to obtain semantic masks.
- LiDAR data is processed (using utils/lidar.py) and fused with segmentation outputs through the pointpainting.py module.
- The fused output is used to generate the occupancy grid map (maps.py) and further processed for clustering and tracking.
- Control Flow:
- main.py functions as the entry point, orchestrating these diverse modules in the correct order.

##### Architectural Patterns & Design Principles
- Modular Design:
- Each major function (segmentation, calibration, fusion, mapping) is separated into individual modules, which helps in clarity and maintainability.
- Pipeline Architecture:
- The structure follows a clear pipeline: input data → preprocessing → segmentation → fusion → mapping → clustering/tracking → visualization.
- Configuration Driven:
- Settings in config/settings.yaml ensure that paths and parameters are easily manageable.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Input Layer
    subgraph "Data Input Layer"
        A["KITTI Dataset (LiDAR & Camera Data)"]
    end

    %% Configuration Layer
    subgraph "Configuration Layer"
        B["Configuration Module"]
    end

    %% Preprocessing & Calibration Layer
    subgraph "Preprocessing & Calibration"
        C["kitti_calibration.py"]
        D["kitti_video.py"]
        E["utils/lidar.py"]
    end

    %% Semantic Segmentation Layer
    subgraph "Semantic Segmentation"
        F["BiSeNetv2 (Semantic Segmentation)"]
    end

    %% Point Cloud Fusion Layer
    subgraph "Point Cloud Fusion"
        G["pointpainting.py"]
    end

    %% Mapping & Clustering Layer
    subgraph "Mapping & Clustering"
        H1["maps.py"]
        H2["main.py (Orchestrator & Clustering)"]
    end

    %% Visualization Layer
    subgraph "Visualization"
        I1["Demo Assets"]
        I2["Visualization Script"]
    end

    %% Data Flow
    A --> B
    B --> C
    B --> D
    B --> E
    C --> D
    C --> E
    D --> F
    E --> G
    F --> G
    G --> H1
    H1 --> H2
    H2 --> I1
    I1 --> I2

    %% Click Events
    click B "https://github.com/harrylal/simulation-of-birds-eye-view-map-generation-from-rgbd-data/blob/main/config/settings.yaml"
    click C "https://github.com/harrylal/simulation-of-birds-eye-view-map-generation-from-rgbd-data/blob/main/kitti_calibration.py"
    click D "https://github.com/harrylal/simulation-of-birds-eye-view-map-generation-from-rgbd-data/blob/main/kitti_video.py"
    click E "https://github.com/harrylal/simulation-of-birds-eye-view-map-generation-from-rgbd-data/blob/main/utils/lidar.py"
    click F "https://github.com/harrylal/simulation-of-birds-eye-view-map-generation-from-rgbd-data/tree/main/models/BiSeNetv2"
    click G "https://github.com/harrylal/simulation-of-birds-eye-view-map-generation-from-rgbd-data/blob/main/pointpainting.py"
    click H1 "https://github.com/harrylal/simulation-of-birds-eye-view-map-generation-from-rgbd-data/blob/main/maps.py"
    click H2 "https://github.com/harrylal/simulation-of-birds-eye-view-map-generation-from-rgbd-data/blob/main/main.py"
    click I1 "https://github.com/harrylal/simulation-of-birds-eye-view-map-generation-from-rgbd-data/tree/main/assets"
    click I2 "https://github.com/harrylal/simulation-of-birds-eye-view-map-generation-from-rgbd-data/blob/main/models/BiSeNetv2/visualization.py"

    %% Styles
    class A blue
    class B,C,D,E green
    class F orange
    class G,H1,H2 purple
    class I1,I2 yellow

    %% Class Definitions
    classDef blue fill:#CCECFF,stroke:#0077B6,stroke-width:2px;
    classDef green fill:#DCFCE7,stroke:#2F9E44,stroke-width:2px;
    classDef orange fill:#FFE5B4,stroke:#FF8C00,stroke-width:2px;
    classDef purple fill:#E0BBE4,stroke:#9D4EDD,stroke-width:2px;
    classDef yellow fill:#FFF9C4,stroke:#FBC02D,stroke-width:2px;
```
