# keshavgaur1/apda-mitra_project architecture

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

- Interactive diagram: https://gitdiagram.com/keshavgaur1/apda-mitra_project
- Repository: https://github.com/keshavgaur1/apda-mitra_project

## Overview

##### Project Type and Purpose
- This project is a disaster relief and response solution specifically designed to support emergency management during floods and wildfires.
- It uses satellite data (including NOAA-20’s VIIRS), AI-driven image processing (semantic segmentation for flood extent analysis), and drone imagery processed with YOLOv8 for real-time victim detection.
- The system is meant to enhance situational awareness, provide early warnings, and optimize resource allocation during disaster scenarios.

##### Analyzing the File Structure
- Top-level Files and Folders:
- “app.py”: Likely the main application entry point, which orchestrates or ties together the various components.
- “assets/”: Contains images used in the UI or for demonstration (e.g., floods, wildfire data, victim detection visualizations).
- “Flood_mapping/”: Contains notebooks for flood detection and segmentation, which indicate the use of AI for evaluating flood impact.
- “detectFloodVictims/”: Holds notebooks and subdirectories (runs, weights, test_images) for YOLO-based detection of victims; this implies a computer vision pipeline.
- “detectWildFire/”: Contains a notebook for wildfire detection, further indicating specialized processing for satellite imagery.
- “pages/”: Contains Python scripts (e.g., 🆘save_victims.py, 🌊floods.py, 👨‍🚒wildfire.py) that are probably part of a front-end or API routes that drive user-facing features.
- “requirements.txt” and “packages.txt”: List dependencies that support various aspects of the system.
- The structure suggests a mixed architecture where distinct modules manage specialized processing tasks (flood segmentation, victim detection, wildfire detection) along with an interface layer.

##### Key Architectural Components
a. Data Sources:
- Satellite Imagery Feed: Utilizes NOAA-20 VIIRS sensors (especially for wildfire detection and flood mapping).
- Drone Imagery: For real-time, on-ground rescue operations (victim detection).
b. Data Processing Modules:
- Flood Mapping Module (Flood_mapping): Includes AI segmentation for risk assessment.
- Victim Detection Module (detectFloodVictims): Employs YOLOv8-based object detection to identify stranded victims.
- Wildfire Detection Module (detectWildFire): Processes satellite imagery to flag early-stage wildfires.
c. Application Entry and Routing:
- The main application (app.py) possibly integrates the processed data and provides API endpoints.
- “pages/” directory components might be used for rendering results to end users (web dashboard or similar).
d. Storage/Asset Management:
- “assets/”: Stores static images/visualizations that are referenced in the interface or documentation.
e. Output and Communication:
- A visual dashboard or web UI (leveraging components in the pages folder) provides real-time alerts and visualizations to disaster responders.

##### Specific Elements
- For each component, include technology/tool hints (e.g., YOLOv8 in Victim Detection, semantic segmentation in Flood Mapping).
- Aggregation point (app.py) connecting the processing results to user-facing dashboards.

- Flood Mapping (from Flood_mapping folder)
- Victim Detection (from detectFloodVictims)
- Wildfire Detection (from detectWildFire)
- Finally, at the right side, add the “User Interface/Dashboard (pages/)” that delivers alerts, maps, and real-time information.
- “assets/” as part of static content storage accessible by the dashboard.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "External Data Sources"
        SI["Satellite Imagery (NOAA-20 VIIRS)"]:::externalInput
        DI["Drone Imagery"]:::externalInput
    end

    subgraph "Processing Modules"
        subgraph "Flood Mapping"
            FM1["Flood Detection (AI Segmentation)"]:::processing
            FM2["Flood Segmentation (AI)"]:::processing
        end
        subgraph "Victim Detection"
            VDM_nb["Victim Detection (YOLOv8 Notebook)"]:::processing
            VDM_runs["Victim Detection (Runs)"]:::processing
        end
        WFD["Wildfire Detection"]:::processing
    end

    subgraph "Orchestration & Storage"
        A["Application Entry (app.py)"]:::orchestration
        Assets["Static Assets (assets/)"]:::storage
    end

    subgraph "User Interface / Dashboard"
        UI["User Dashboard (pages/)"]:::ui
    end

    SI -->|"feeds"| FM1
    SI -->|"feeds"| WFD
    DI -->|"feeds"| VDM_nb
    FM1 -->|"outputs"| A
    FM2 -->|"outputs"| A
    VDM_nb -->|"outputs"| A
    VDM_runs -->|"outputs"| A
    WFD -->|"outputs"| A
    A -->|"serves"| UI
    A -->|"manages"| Assets

    click FM1 "https://github.com/keshavgaur1/apda-mitra_project/blob/main/Flood_mapping/flood_detection.ipynb"
    click FM2 "https://github.com/keshavgaur1/apda-mitra_project/blob/main/Flood_mapping/flood_segmentation.ipynb"
    click VDM_nb "https://github.com/keshavgaur1/apda-mitra_project/blob/main/detectFloodVictims/Yolo_disaster_relief.ipynb"
    click VDM_runs "https://github.com/keshavgaur1/apda-mitra_project/tree/main/detectFloodVictims/runs/"
    click WFD "https://github.com/keshavgaur1/apda-mitra_project/blob/main/detectWildFire/detectwildfires.ipynb"
    click A "https://github.com/keshavgaur1/apda-mitra_project/blob/main/app.py"
    click UI "https://github.com/keshavgaur1/apda-mitra_project/tree/main/pages/"
    click Assets "https://github.com/keshavgaur1/apda-mitra_project/tree/main/assets/"

    classDef externalInput fill:#FFECB3,stroke:#E65100,stroke-width:2px;
    classDef processing fill:#BBDEFB,stroke:#1E88E5,stroke-width:2px;
    classDef orchestration fill:#C8E6C9,stroke:#43A047,stroke-width:2px;
    classDef ui fill:#F0F4C3,stroke:#7CB342,stroke-width:2px;
    classDef storage fill:#D7CCC8,stroke:#5D4037,stroke-width:2px;
```
