# shayanthn/smoke-spark-fire-detection-ai architecture

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

- Interactive diagram: https://gitdiagram.com/shayanthn/smoke-spark-fire-detection-ai
- Repository: https://github.com/shayanthn/smoke-spark-fire-detection-ai

## Overview

FLARE detects fire and smoke from live camera feeds or existing video, then presents annotated results and alerts. The advanced application combines detection, a Tkinter interface, performance metrics, and event logging; separate examples support IP cameras and batch video processing, while the base script provides an educational version. Some advanced orchestration is outside the excerpts, so those connections are shown only where documented in the README or explicit in sampled example code.

Main entry points: [`fire_smoke_detector_advanced.py`](https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/fire_smoke_detector_advanced.py) (Advanced Detector App), [`example_video_processing.py`](https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/example_video_processing.py) (Video Processor), [`example_ip_camera.py`](https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/example_ip_camera.py) (IP Camera Adapter), [`fire_smoke_detector_base.py`](https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/fire_smoke_detector_base.py) (Educational Detector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Live Detection"]
  node_advanced["Advanced Detector App"]
  node_fire["Fire Detection"]
  node_smoke["Smoke Detection"]
  node_ui["Live UI"]
  node_alerts["Alert Manager"]
  node_metrics["Performance Metrics"]
  node_eventlog["Event Log"]
  node_ipcamera["IP Camera Adapter"]
end

subgraph group_processing["Video Processing"]
  node_processor["Video Processor"]
  node_report["Detection Reports"]
end

subgraph group_learning["Learning Version"]
  node_base["Educational Detector"]
end

node_user(("Operator"))
node_camera["Camera"]
node_networkcamera["IP Camera Stream"]
node_videoinput["Video Files"]

node_user -->|"starts"| node_advanced
node_camera -->|"provides frames"| node_advanced
node_advanced -->|"runs detection"| node_fire
node_advanced -->|"runs detection"| node_smoke
node_advanced -->|"updates display"| node_ui
node_advanced -->|"triggers alerts"| node_alerts
node_advanced -->|"tracks performance"| node_metrics
node_advanced -->|"logs events"| node_eventlog
node_user -->|"starts"| node_ipcamera
node_networkcamera -->|"streams video"| node_ipcamera
node_ipcamera -->|"extends detector"| node_advanced
node_user -->|"runs processing"| node_processor
node_videoinput -->|"supplies frames"| node_processor
node_processor -->|"calls detection"| node_advanced
node_processor -->|"writes results"| node_report
node_user -->|"starts learning app"| node_base

click node_advanced "https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/fire_smoke_detector_advanced.py"
click node_fire "https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/fire_smoke_detector_advanced.py"
click node_smoke "https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/fire_smoke_detector_advanced.py"
click node_ui "https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/fire_smoke_detector_advanced.py"
click node_alerts "https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/fire_smoke_detector_advanced.py"
click node_metrics "https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/fire_smoke_detector_advanced.py"
click node_eventlog "https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/fire_smoke_detector_advanced.py"
click node_ipcamera "https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/example_ip_camera.py"
click node_processor "https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/example_video_processing.py"
click node_report "https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/example_video_processing.py"
click node_base "https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/fire_smoke_detector_base.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_advanced,node_fire,node_smoke,node_ui,node_alerts,node_metrics,node_eventlog,node_ipcamera toneBlue
class node_processor,node_report toneAmber
class node_base toneMint
class node_user,node_camera,node_networkcamera,node_videoinput toneIndigo
```

## Components

### Live Detection

- [Advanced Detector App](https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/fire_smoke_detector_advanced.py): `fire_smoke_detector_advanced.py`
- [Fire Detection](https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/fire_smoke_detector_advanced.py): `fire_smoke_detector_advanced.py`
- [Smoke Detection](https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/fire_smoke_detector_advanced.py): `fire_smoke_detector_advanced.py`
- [Live UI](https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/fire_smoke_detector_advanced.py): `fire_smoke_detector_advanced.py`
- [Alert Manager](https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/fire_smoke_detector_advanced.py): `fire_smoke_detector_advanced.py`
- [Performance Metrics](https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/fire_smoke_detector_advanced.py): `fire_smoke_detector_advanced.py`
- [Event Log](https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/fire_smoke_detector_advanced.py): `fire_smoke_detector_advanced.py`
- [IP Camera Adapter](https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/example_ip_camera.py): `example_ip_camera.py`

### Video Processing

- [Video Processor](https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/example_video_processing.py): `example_video_processing.py`
- [Detection Reports](https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/example_video_processing.py): `example_video_processing.py`

### Learning Version

- [Educational Detector](https://github.com/shayanthn/smoke-spark-fire-detection-ai/blob/main/fire_smoke_detector_base.py): `fire_smoke_detector_base.py`

### Other components

- **Operator**
- **Camera**
- **IP Camera Stream**
- **Video Files**

## Connections

- Operator → Advanced Detector App: starts (evidence: `README.md`)
- Camera → Advanced Detector App: provides frames (evidence: `README.md`)
- Advanced Detector App → Fire Detection: runs detection (evidence: `README.md`)
- Advanced Detector App → Smoke Detection: runs detection (evidence: `README.md`)
- Advanced Detector App → Live UI: updates display (evidence: `README.md`)
- Advanced Detector App → Alert Manager: triggers alerts (evidence: `README.md`)
- Advanced Detector App → Performance Metrics: tracks performance (evidence: `README.md`)
- Advanced Detector App → Event Log: logs events (evidence: `README.md`)
- Operator → IP Camera Adapter: starts (evidence: `example_ip_camera.py`)
- IP Camera Stream → IP Camera Adapter: streams video (evidence: `example_ip_camera.py`)
- IP Camera Adapter → Advanced Detector App: extends detector (evidence: `example_ip_camera.py`)
- Operator → Video Processor: runs processing (evidence: `example_video_processing.py`)
- Video Files → Video Processor: supplies frames (evidence: `example_video_processing.py`)
- Video Processor → Advanced Detector App: calls detection (evidence: `example_video_processing.py`)
- Video Processor → Detection Reports: writes results (evidence: `example_video_processing.py`)
- Operator → Educational Detector: starts learning app (evidence: `README.md`)
