# mariammm-bit/multi-crises-detection architecture

> Architecture diagram of the GitHub repository mariammm-bit/multi-crises-detection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mariammm-bit/multi-crises-detection
- Repository: https://github.com/mariammm-bit/multi-crises-detection

## Overview

This is a small smart-building fire, smoke, and occupant monitoring application. A user selects image or camera mode; `main.py` obtains frames, runs fire/smoke and person detection, calculates a risk level, annotates the frame, and displays it. Separate scripts provide person-only image detection and YOLO training. The README gives no further product detail; model internals and dataset contents are not shown.

Main entry points: [`main.py`](https://github.com/mariammm-bit/multi-crises-detection/blob/main/main.py) (Frame processing), [`human_detection.py`](https://github.com/mariammm-bit/multi-crises-detection/blob/main/human_detection.py) (Person image detection), [`danger_analyzer.py`](https://github.com/mariammm-bit/multi-crises-detection/blob/main/danger_analyzer.py) (Risk analysis), [`train.py`](https://github.com/mariammm-bit/multi-crises-detection/blob/main/train.py) (YOLO training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_monitor["Live monitoring"]
  node_menu["Mode selection<br/>[main.py]"]
  node_image_input["Image input<br/>[main.py]"]
  node_camera_input["Camera input<br/>[main.py]"]
  node_frame_processing["Frame processing<br/>[main.py]"]
  node_fire_model["Fire/smoke model"]
  node_person_model["Person model"]
  node_risk_analysis["Risk analysis<br/>[danger_analyzer.py]"]
  node_risk_panel["Risk panel<br/>[danger_analyzer.py]"]
  node_monitor_display["Monitor display<br/>[main.py]"]
end

subgraph group_standalone["Standalone detection"]
  node_person_image_script["Person image detection<br/>[human_detection.py]"]
  node_person_image_model["Person model"]
  node_person_image_output["Image result<br/>[human_detection.py]"]
end

subgraph group_training["Model training"]
  node_training_script["YOLO training<br/>[train.py]"]
  node_training_config["Dataset config<br/>[data.yaml]"]
end

node_user(("Operator"))

node_user -->|"selects mode"| node_menu
node_menu -->|"starts image mode"| node_image_input
node_menu -->|"starts camera mode"| node_camera_input
node_image_input -->|"passes image"| node_frame_processing
node_camera_input -->|"passes frames"| node_frame_processing
node_frame_processing -->|"runs inference"| node_fire_model
node_frame_processing -->|"runs inference"| node_person_model
node_frame_processing -->|"submits counts"| node_risk_analysis
node_frame_processing -->|"requests annotation"| node_risk_panel
node_risk_analysis -->|"provides risk level"| node_risk_panel
node_frame_processing -->|"returns annotated frame"| node_monitor_display
node_person_image_script -->|"runs inference"| node_person_image_model
node_person_image_script -->|"saves and displays"| node_person_image_output
node_training_script -->|"loads configuration"| node_training_config

click node_menu "https://github.com/mariammm-bit/multi-crises-detection/blob/main/main.py"
click node_image_input "https://github.com/mariammm-bit/multi-crises-detection/blob/main/main.py"
click node_camera_input "https://github.com/mariammm-bit/multi-crises-detection/blob/main/main.py"
click node_frame_processing "https://github.com/mariammm-bit/multi-crises-detection/blob/main/main.py"
click node_risk_analysis "https://github.com/mariammm-bit/multi-crises-detection/blob/main/danger_analyzer.py"
click node_risk_panel "https://github.com/mariammm-bit/multi-crises-detection/blob/main/danger_analyzer.py"
click node_monitor_display "https://github.com/mariammm-bit/multi-crises-detection/blob/main/main.py"
click node_person_image_script "https://github.com/mariammm-bit/multi-crises-detection/blob/main/human_detection.py"
click node_person_image_output "https://github.com/mariammm-bit/multi-crises-detection/blob/main/human_detection.py"
click node_training_script "https://github.com/mariammm-bit/multi-crises-detection/blob/main/train.py"
click node_training_config "https://github.com/mariammm-bit/multi-crises-detection/blob/main/data.yaml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_menu,node_image_input,node_camera_input,node_frame_processing,node_fire_model,node_person_model,node_risk_analysis,node_risk_panel,node_monitor_display toneBlue
class node_person_image_script,node_person_image_model,node_person_image_output toneAmber
class node_training_script,node_training_config toneMint
class node_user toneIndigo
```

## Components

### Live monitoring

- [Mode selection](https://github.com/mariammm-bit/multi-crises-detection/blob/main/main.py): `main.py`
- [Image input](https://github.com/mariammm-bit/multi-crises-detection/blob/main/main.py): `main.py`
- [Camera input](https://github.com/mariammm-bit/multi-crises-detection/blob/main/main.py): `main.py`
- [Frame processing](https://github.com/mariammm-bit/multi-crises-detection/blob/main/main.py): `main.py`
- **Fire/smoke model**
- **Person model**
- [Risk analysis](https://github.com/mariammm-bit/multi-crises-detection/blob/main/danger_analyzer.py): `danger_analyzer.py`
- [Risk panel](https://github.com/mariammm-bit/multi-crises-detection/blob/main/danger_analyzer.py): `danger_analyzer.py`
- [Monitor display](https://github.com/mariammm-bit/multi-crises-detection/blob/main/main.py): `main.py`

### Standalone detection

- [Person image detection](https://github.com/mariammm-bit/multi-crises-detection/blob/main/human_detection.py): `human_detection.py`
- **Person model**
- [Image result](https://github.com/mariammm-bit/multi-crises-detection/blob/main/human_detection.py): `human_detection.py`

### Model training

- [YOLO training](https://github.com/mariammm-bit/multi-crises-detection/blob/main/train.py): `train.py`
- [Dataset config](https://github.com/mariammm-bit/multi-crises-detection/blob/main/data.yaml): `data.yaml`

### Other components

- **Operator**

## Connections

- Operator → Mode selection: selects mode (evidence: `main.py`)
- Mode selection → Image input: starts image mode (evidence: `main.py`)
- Mode selection → Camera input: starts camera mode (evidence: `main.py`)
- Image input → Frame processing: passes image (evidence: `main.py`)
- Camera input → Frame processing: passes frames (evidence: `main.py`)
- Frame processing → Fire/smoke model: runs inference (evidence: `main.py`)
- Frame processing → Person model: runs inference (evidence: `main.py`)
- Frame processing → Risk analysis: submits counts (evidence: `main.py`)
- Frame processing → Risk panel: requests annotation (evidence: `main.py`)
- Risk analysis → Risk panel: provides risk level (evidence: `main.py`)
- Frame processing → Monitor display: returns annotated frame (evidence: `main.py`)
- Person image detection → Person model: runs inference (evidence: `human_detection.py`)
- Person image detection → Image result: saves and displays (evidence: `human_detection.py`)
- YOLO training → Dataset config: loads configuration (evidence: `train.py`)
