How sampath123123/fire-smoke-detection works
A compact command-line fire and smoke detector: a user selects a camera, RTSP stream, or video file; the loop runs YOLO inference, groups persistent detections into events, and writes qualifying events to CSV. Annotated video and on-screen display are optional outputs. Runtime responsibilities are implemented together in detect.py, so the graph separates domain stages without implying separate modules. The model file is the supplied detector; source evidence for its internal behavior is not available.
Main entry points: detect.py Frame loop · fire.pt Fire/smoke weights
Components 14
Video capture
- Camera, RTSP, or file
- Source selection
detect.py - Frame loop
detect.py
Detection
- Fire/smoke weights
models/fire.pt - YOLO inference
detect.py - Confidence filtering
detect.py
Event processing
- Open event state
detect.py - Persistence and gap rules
detect.py - Event record formatting
detect.py
Outputs
- Event CSV
- Frame annotation
detect.py - Live display
detect.py - Annotated video
Other components
- Operator
Connections 15
- Operator → Source selection: selects source
README.md - Camera, RTSP, or file → Source selection: provides stream
detect.py - Source selection → Frame loop: opens capture
detect.py - Frame loop → YOLO inference: submits frames
detect.py - Fire/smoke weights → YOLO inference: provides weights
detect.py - YOLO inference → Confidence filtering: returns detections
detect.py - Confidence filtering → Open event state: updates sightings
detect.py - Frame loop → Persistence and gap rules: checks elapsed gaps
detect.py - Persistence and gap rules → Open event state: closes qualifying events
detect.py - Open event state → Event record formatting: supplies event data
detect.py - Event record formatting → Event CSV: appends rows
detect.py - Confidence filtering → Frame annotation: draws detections
detect.py - Frame loop → Live display: shows frames
detect.py - Frame annotation → Live display: renders overlay
detect.py - Frame annotation → Annotated video: writes frames
detect.py