# amantyagii/fire_smoke_severity_detection architecture

> Architecture diagram of the GitHub repository amantyagii/fire_smoke_severity_detection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amantyagii/fire_smoke_severity_detection
- Repository: https://github.com/amantyagii/fire_smoke_severity_detection

## Overview

This is a batch fire-and-smoke severity analysis tool: it reads image files, runs a trained YOLO model, estimates fire and smoke coverage, assigns configurable severity levels, and reports detection counts. The `process_firesmoke.py` entry point also writes annotated images; `process_fire_final.py` draws annotations but does not save them in the shown code. The scripts contain their own severity calculations and reporting logic. The graph reflects the sampled source and README; no unshown runtime wiring is assumed.

Main entry points: [`process_firesmoke.py`](https://github.com/amantyagii/fire_smoke_severity_detection/blob/main/process_firesmoke.py) (Annotated batch runner), [`process_fire_final.py`](https://github.com/amantyagii/fire_smoke_severity_detection/blob/main/process_fire_final.py) (Final batch runner), [`dataset/final_images`](https://github.com/amantyagii/fire_smoke_severity_detection/tree/main/dataset/final_images) (Image dataset), [`config.py`](https://github.com/amantyagii/fire_smoke_severity_detection/blob/main/config.py) (Severity thresholds)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs and model"]
  node_images["Image dataset"]
  node_model_artifact["YOLO weights<br/>[best.pt]"]
end

subgraph group_analysis["Detection and severity"]
  node_config["Severity thresholds<br/>[config.py]"]
  node_final_runner["Final batch runner"]
  node_smoke_runner["Annotated batch runner"]
  node_yolo["YOLO inference"]
  node_fire_calc["Fire coverage severity"]
  node_smoke_calc["Smoke coverage severity"]
end

subgraph group_results["Results"]
  node_annotator["Image annotation"]
  node_annotated_images["Annotated images"]
  node_reports["Detection statistics"]
end

node_terminal(("Console output"))

node_images -->|"reads images"| node_final_runner
node_images -->|"reads images"| node_smoke_runner
node_model_artifact -->|"loads weights"| node_yolo
node_smoke_runner -->|"runs inference"| node_yolo
node_smoke_runner -.-> node_final_runner
node_smoke_runner -->|"calculates fire severity"| node_fire_calc
node_smoke_runner -->|"calculates smoke severity"| node_smoke_calc
node_config -->|"sets thresholds"| node_fire_calc
node_config -->|"sets thresholds"| node_smoke_calc
node_smoke_runner -->|"draws detections"| node_annotator
node_annotator -->|"writes images"| node_annotated_images
node_smoke_runner -->|"updates counts"| node_reports
node_reports -->|"prints summary"| node_terminal
node_final_runner -->|"prints summary"| node_terminal

click node_images "https://github.com/amantyagii/fire_smoke_severity_detection/tree/main/dataset/final_images"
click node_model_artifact "https://github.com/amantyagii/fire_smoke_severity_detection/blob/main/best.pt"
click node_config "https://github.com/amantyagii/fire_smoke_severity_detection/blob/main/config.py"
click node_final_runner "https://github.com/amantyagii/fire_smoke_severity_detection/blob/main/process_fire_final.py"
click node_smoke_runner "https://github.com/amantyagii/fire_smoke_severity_detection/blob/main/process_firesmoke.py"
click node_yolo "https://github.com/amantyagii/fire_smoke_severity_detection/blob/main/process_firesmoke.py"
click node_fire_calc "https://github.com/amantyagii/fire_smoke_severity_detection/blob/main/process_firesmoke.py"
click node_smoke_calc "https://github.com/amantyagii/fire_smoke_severity_detection/blob/main/process_firesmoke.py"
click node_annotator "https://github.com/amantyagii/fire_smoke_severity_detection/blob/main/process_firesmoke.py"
click node_annotated_images "https://github.com/amantyagii/fire_smoke_severity_detection/tree/main/output/annotated"
click node_reports "https://github.com/amantyagii/fire_smoke_severity_detection/blob/main/process_firesmoke.py"

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_images,node_model_artifact toneBlue
class node_config,node_final_runner,node_smoke_runner,node_yolo,node_fire_calc,node_smoke_calc toneAmber
class node_annotator,node_annotated_images,node_reports toneMint
class node_terminal toneIndigo
```

## Components

### Inputs and model

- [Image dataset](https://github.com/amantyagii/fire_smoke_severity_detection/tree/main/dataset/final_images): `dataset/final_images`
- [YOLO weights](https://github.com/amantyagii/fire_smoke_severity_detection/blob/main/best.pt): `best.pt`

### Detection and severity

- [Severity thresholds](https://github.com/amantyagii/fire_smoke_severity_detection/blob/main/config.py): `config.py`
- [Final batch runner](https://github.com/amantyagii/fire_smoke_severity_detection/blob/main/process_fire_final.py): `process_fire_final.py`
- [Annotated batch runner](https://github.com/amantyagii/fire_smoke_severity_detection/blob/main/process_firesmoke.py): `process_firesmoke.py`
- [YOLO inference](https://github.com/amantyagii/fire_smoke_severity_detection/blob/main/process_firesmoke.py): `process_firesmoke.py`
- [Fire coverage severity](https://github.com/amantyagii/fire_smoke_severity_detection/blob/main/process_firesmoke.py): `process_firesmoke.py`
- [Smoke coverage severity](https://github.com/amantyagii/fire_smoke_severity_detection/blob/main/process_firesmoke.py): `process_firesmoke.py`

### Results

- [Image annotation](https://github.com/amantyagii/fire_smoke_severity_detection/blob/main/process_firesmoke.py): `process_firesmoke.py`
- [Annotated images](https://github.com/amantyagii/fire_smoke_severity_detection/tree/main/output/annotated): `output/annotated`
- [Detection statistics](https://github.com/amantyagii/fire_smoke_severity_detection/blob/main/process_firesmoke.py): `process_firesmoke.py`

### Other components

- **Console output**

## Connections

- Image dataset → Final batch runner: reads images (evidence: `process_fire_final.py`)
- Image dataset → Annotated batch runner: reads images (evidence: `process_firesmoke.py`)
- YOLO weights → YOLO inference: loads weights (evidence: `process_firesmoke.py`)
- Annotated batch runner → YOLO inference: runs inference (evidence: `process_firesmoke.py`)
- Annotated batch runner → Final batch runner
- Annotated batch runner → Fire coverage severity: calculates fire severity (evidence: `process_firesmoke.py`)
- Annotated batch runner → Smoke coverage severity: calculates smoke severity (evidence: `process_firesmoke.py`)
- Severity thresholds → Fire coverage severity: sets thresholds (evidence: `process_firesmoke.py`)
- Severity thresholds → Smoke coverage severity: sets thresholds (evidence: `process_firesmoke.py`)
- Annotated batch runner → Image annotation: draws detections (evidence: `process_firesmoke.py`)
- Image annotation → Annotated images: writes images (evidence: `process_firesmoke.py`)
- Annotated batch runner → Detection statistics: updates counts (evidence: `process_firesmoke.py`)
- Detection statistics → Console output: prints summary (evidence: `process_firesmoke.py`)
- Final batch runner → Console output: prints summary (evidence: `process_fire_final.py`)
