# maxgertner/wildfire-detection architecture

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

- Interactive diagram: https://gitdiagram.com/maxgertner/wildfire-detection
- Repository: https://github.com/maxgertner/wildfire-detection

## Overview

This repository is a set of webcam-based fire-detection examples using FireNet, InceptionV1-OnFire, and a superpixel variant, plus utilities to export trained networks to TensorFlow protobuf. The main runtime flow captures frames, classifies them, and either displays annotated results or streams frames through Flask. The README provides no further capability details; the streamer's authentication support is visible in its source, but its imported login manager is not present in the supplied tree.

Main entry points: [`fire-detection/converter/converter.py`](https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/converter/converter.py) (Export helper), [`fire-detection/firenet.py`](https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/firenet.py) (FireNet runtime), [`fire-detection/onFire.py`](https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/onFire.py) (Inception runtime), [`fire-detection/superpixel-fire.py`](https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/superpixel-fire.py) (Superpixel runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_detection["Detection runtimes"]
  node_firenet_runtime["FireNet runtime<br/>[firenet.py]"]
  node_inception_runtime["Inception runtime<br/>[onFire.py]"]
  node_superpixel_runtime["Superpixel runtime<br/>[superpixel-fire.py]"]
end

subgraph group_models["CNN models"]
  node_firenet_model["FireNet network<br/>[firenet.py]"]
  node_inception_model["Inception network<br/>[onFire.py]"]
  node_superpixel_model["Superpixel network<br/>[superpixel-fire.py]"]
  node_firenet_weights["FireNet weights"]
  node_inception_weights["Inception weights"]
  node_superpixel_weights["Superpixel weights"]
end

subgraph group_stream["Video streaming"]
  node_streamer["Flask streamer<br/>[streamer.py]"]
end

subgraph group_export["Model export"]
  node_converter["Export helper<br/>[converter.py]"]
  node_firenet_export["FireNet exporter"]
  node_inception_export["Inception exporter"]
  node_protobuf["Frozen protobuf"]
end

node_camera(("Camera"))
node_viewer(("Stream viewer"))
node_local_viewer(("Local display"))

node_camera -->|"supplies frames"| node_firenet_runtime
node_camera -->|"supplies frames"| node_inception_runtime
node_camera -->|"supplies frames"| node_superpixel_runtime
node_firenet_runtime -->|"predicts with"| node_firenet_model
node_inception_runtime -->|"predicts with"| node_inception_model
node_superpixel_runtime -->|"predicts segments"| node_superpixel_model
node_firenet_weights -->|"loads weights"| node_firenet_runtime
node_inception_weights -->|"loads weights"| node_inception_runtime
node_superpixel_weights -->|"loads weights"| node_superpixel_runtime
node_firenet_runtime -->|"updates frames"| node_streamer
node_superpixel_runtime -->|"updates frames"| node_streamer
node_streamer -->|"serves video"| node_viewer
node_inception_runtime -->|"displays results"| node_local_viewer
node_firenet_export -->|"constructs"| node_firenet_model
node_inception_export -->|"constructs"| node_inception_model
node_firenet_export -->|"invokes export"| node_converter
node_inception_export -->|"invokes export"| node_converter
node_converter -->|"loads checkpoint"| node_firenet_weights
node_converter -->|"loads checkpoint"| node_inception_weights
node_converter -->|"writes model"| node_protobuf

click node_firenet_runtime "https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/firenet.py"
click node_inception_runtime "https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/onFire.py"
click node_superpixel_runtime "https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/superpixel-fire.py"
click node_firenet_model "https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/firenet.py"
click node_inception_model "https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/onFire.py"
click node_superpixel_model "https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/superpixel-fire.py"
click node_firenet_weights "https://github.com/maxgertner/wildfire-detection/tree/master/fire-detection/models/fire_detection"
click node_inception_weights "https://github.com/maxgertner/wildfire-detection/tree/master/fire-detection/models/SP-InceptionV1-OnFire"
click node_superpixel_weights "https://github.com/maxgertner/wildfire-detection/tree/master/fire-detection/models/SP-InceptionV1-OnFire"
click node_streamer "https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/flask_opencv_streamer/streamer.py"
click node_converter "https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/converter/converter.py"
click node_firenet_export "https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/converter/firenet-to-protobuf.py"
click node_inception_export "https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/converter/inceptionV1OnFire-to-protobuf.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_firenet_runtime,node_inception_runtime,node_superpixel_runtime,node_viewer toneBlue
class node_firenet_model,node_inception_model,node_superpixel_model,node_firenet_weights,node_inception_weights,node_superpixel_weights toneAmber
class node_streamer toneMint
class node_converter,node_firenet_export,node_inception_export,node_protobuf toneRose
class node_camera,node_local_viewer toneIndigo
```

## Components

### Detection runtimes

- [FireNet runtime](https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/firenet.py): `fire-detection/firenet.py`
- [Inception runtime](https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/onFire.py): `fire-detection/onFire.py`
- [Superpixel runtime](https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/superpixel-fire.py): `fire-detection/superpixel-fire.py`

### CNN models

- [FireNet network](https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/firenet.py): `fire-detection/firenet.py`
- [Inception network](https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/onFire.py): `fire-detection/onFire.py`
- [Superpixel network](https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/superpixel-fire.py): `fire-detection/superpixel-fire.py`
- [FireNet weights](https://github.com/maxgertner/wildfire-detection/tree/master/fire-detection/models/fire_detection): `fire-detection/models/fire_detection`
- [Inception weights](https://github.com/maxgertner/wildfire-detection/tree/master/fire-detection/models/SP-InceptionV1-OnFire): `fire-detection/models/SP-InceptionV1-OnFire`
- [Superpixel weights](https://github.com/maxgertner/wildfire-detection/tree/master/fire-detection/models/SP-InceptionV1-OnFire): `fire-detection/models/SP-InceptionV1-OnFire`

### Video streaming

- [Flask streamer](https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/flask_opencv_streamer/streamer.py): `fire-detection/flask_opencv_streamer/streamer.py`

### Model export

- [Export helper](https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/converter/converter.py): `fire-detection/converter/converter.py`
- [FireNet exporter](https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/converter/firenet-to-protobuf.py): `fire-detection/converter/firenet-to-protobuf.py`
- [Inception exporter](https://github.com/maxgertner/wildfire-detection/blob/master/fire-detection/converter/inceptionV1OnFire-to-protobuf.py): `fire-detection/converter/inceptionV1OnFire-to-protobuf.py`
- **Frozen protobuf**

### Other components

- **Camera**
- **Stream viewer**
- **Local display**

## Connections

- Camera → FireNet runtime: supplies frames
- Camera → Inception runtime: supplies frames
- Camera → Superpixel runtime: supplies frames
- FireNet runtime → FireNet network: predicts with
- Inception runtime → Inception network: predicts with
- Superpixel runtime → Superpixel network: predicts segments
- FireNet weights → FireNet runtime: loads weights
- Inception weights → Inception runtime: loads weights
- Superpixel weights → Superpixel runtime: loads weights
- FireNet runtime → Flask streamer: updates frames
- Superpixel runtime → Flask streamer: updates frames
- Flask streamer → Stream viewer: serves video
- Inception runtime → Local display: displays results
- FireNet exporter → FireNet network: constructs
- Inception exporter → Inception network: constructs
- FireNet exporter → Export helper: invokes export
- Inception exporter → Export helper: invokes export
- Export helper → FireNet weights: loads checkpoint
- Export helper → Inception weights: loads checkpoint
- Export helper → Frozen protobuf: writes model
