How leo4bits/person_fire_smoke_detection_esp32 works
This repository implements a fire-and-smoke monitoring prototype: ESP32 temperature, humidity, and gas readings are classified while webcam frames are analyzed for people, fire, and smoke, with both results shown in a live overlay. A separate collector path saves raw sensor readings as JSON. The graph follows explicit calls and data transfers in the sampled runtime files; SAHI is documented in code as an alternative detector, while README capabilities without clear runtime wiring are not expanded.
Main entry points: mainTest.py Live monitor · main.cpp ESP32 sampling · MODEL_USING.py Detection facade · sensors.cpp Sensor drivers
Components 19
Sensor firmware
- ESP32 sampling
GetDataFromSensor/GetDataSensor/src/main.cpp - Sensor drivers
GetDataFromSensor/GetDataSensor/src/sensors.cpp
Sensor processing
- UART reader
GetDataFromSensor/threadGetData/thread.py - Gas classification
PreProcessing/numPreProcessing.py - Air quality model
random_forest_air_quality.pkl - Raw data collector
GetDataFromSensor/PushDataForModel/pushData.py - Sensor data saver
GetDataFromSensor/SaveDataFormSensors/saveDataFromsens.py - Saved sensor JSON
Vision detection
- CLAHE enhancement
PreProcessing/imgPreProcessing.py - Detection facade
MODEL_USING.py - YOLO weights
best.pt
Live application
- Live monitor
mainTest.py - Overlay labels
PreProcessing/outputGUI.py
Other components
- Operator
- DHT11 / MQ135
- Webcam
- Live display
- Ultralytics YOLO
- SAHI inference
Connections 20
- DHT11 / MQ135 → Sensor drivers: provides readings
- ESP32 sampling → Sensor drivers: reads sensors
- Sensor drivers → ESP32 sampling: returns measurements
- ESP32 sampling → UART reader: streams JSON over UART
- ESP32 sampling → Raw data collector: streams JSON over UART
- ESP32 sampling → Sensor data saver: streams JSON over UART
- UART reader → Gas classification: classifies readings
- Gas classification → Air quality model: loads model
- Raw data collector → Saved sensor JSON: writes on interrupt
- Sensor data saver → Saved sensor JSON: writes on interrupt
- Webcam → Live monitor: provides frames
- Live monitor → CLAHE enhancement: enhances frames
- Live monitor → Detection facade: requests detections
- Detection facade → Ultralytics YOLO: runs YOLO
- Detection facade → SAHI inference: runs sliced inference
- YOLO weights → Detection facade: loads weights
- Live monitor → UART reader: reads predicted state
- Live monitor → Overlay labels: formats labels
- Live monitor → Live display: renders overlay
- Operator → Live display: views results