How deepankarvarma/fire-detection--opencv-keras-tensorflow works
This repository trains a binary fire classifier and uses the saved model in two inference paths: a Streamlit image-upload app and a local video-frame detector. Training reads labeled image folders, prepares and splits the data, defines and fits a CNN, then saves the model artifact. The README documents image classification; the sampled code also implements video inference. The training, display, and thresholding behavior is visible in the excerpts; no additional application services are indicated.
Main entry points: app.py Streamlit app · predictlocally.py Video frame detector · fire_detection_model.h5 Trained model · model.py Load and split data
Components 12
Model training
- Load and split data
model.py - CNN architecture
model.py - Train classifier
model.py
Image inference
- Streamlit app
app.py - Image preprocessing
app.py - Image prediction result
app.py
Video inference
- Video frame detector
predictlocally.py
Other components
- Fire dataset
- Trained model
fire_detection_model.h5 - Image uploader
- Sample video
fire.mp4 - Video display
Connections 11
- Fire dataset → Load and split data: provides images
model.py - Load and split data → CNN architecture: feeds training
model.py - CNN architecture → Train classifier: defines network
model.py - Train classifier → Trained model: saves model
model.py - Image uploader → Streamlit app: uploads image
app.py - Streamlit app → Trained model: loads model
app.py - Streamlit app → Image preprocessing: preprocesses image
app.py - Streamlit app → Image prediction result: predicts and displays
app.py - Sample video → Video frame detector: provides frames
predictlocally.py - Video frame detector → Trained model: loads model
predictlocally.py - Video frame detector → Video display: shows annotated frames
predictlocally.py