How maheshkhadilkar07/stampede-prediction-with-alerts-system works
StampedeGuard is a Flask application for analyzing uploaded footage and live CCTV to detect crowd risk, present results, and notify authorities. The main workflows are upload → background video processing → dashboard/history, and camera → live stream processing → live dashboard/alerts. The graph preserves authentication, administration, persistence, analytics, and PDF reports. Source excerpts show the video-processing orchestration and alert persistence; documented capabilities support other links. Some route-level details and detector internals were not sampled, so those connections are based on the README or omitted where uncertain.
Main entry points: stream_manager.py Live session manager · app.py Flask routes · video_processor.py Uploaded video processing · history.py History and analytics
Components 23
Web application
- Flask routes
app.py - Web pages
templates - Authentication and OTP
utils/otp_service.py
Crowd analysis
- Uploaded video processing
detector/video_processor.py - Person detection
detector/person_detector.py - Crowd counting
detector/crowd_counter.py - Density estimation
detector/density_estimator.py - Risk analysis
detector/risk_analyzer.py - Heatmap overlay
detector/heatmap.py
Live streaming
- Camera reader
streaming/camera_reader.py - Frame producer
streaming/producer.py - Frame consumer
streaming/consumer.py - Live session manager
streaming/stream_manager.py
Persistence and alerts
- SQLite database
database/database.py - User/video/alert records
database/models.py - History and analytics
database/history.py - Risk notifications
utils/email_alert.py
Supporting services
- Email delivery
utils/mailer.py - PDF reports
utils/report_generator.py
Other components
- User
- Camera / CCTV
- Fluvio topic
- Email recipients
Connections 32
- User → Flask routes: uses
README.md - Flask routes → Web pages: renders
README.md - Flask routes → Authentication and OTP: verifies OTP
app.py - Flask routes → Uploaded video processing: starts background processing
README.md - Uploaded video processing → Person detection: detects people
detector/video_processor.py - Uploaded video processing → Crowd counting: counts crowd
detector/video_processor.py - Uploaded video processing → Density estimation: estimates density
detector/video_processor.py - Uploaded video processing → Risk analysis: scores risk
detector/video_processor.py - Uploaded video processing → Heatmap overlay: generates overlay
detector/video_processor.py - Camera / CCTV → Live session manager: provides frames
README.md - Flask routes → Live session manager: starts live session
README.md - Live session manager → Camera reader: opens source
streaming/stream_manager.py - Live session manager → Frame producer: publishes frames
streaming/stream_manager.py - Frame producer → Fluvio topic: sends frames
README.md - Fluvio topic → Frame consumer: delivers frames
README.md - Live session manager → Frame consumer: reads frames
streaming/stream_manager.py - Live session manager → Person detection: detects people
streaming/stream_manager.py - Live session manager → Crowd counting: counts crowd
streaming/stream_manager.py - Live session manager → Density estimation: estimates density
streaming/stream_manager.py - Live session manager → Risk analysis: scores risk
streaming/stream_manager.py - Live session manager → Heatmap overlay: generates overlay
README.md - Flask routes → SQLite database: initializes
README.md - SQLite database → User/video/alert records: creates tables
database/database.py - Flask routes → User/video/alert records: persists results
app.py - Flask routes → History and analytics: queries history
database/history.py - History and analytics → Risk notifications: requests delivery
database/history.py - Flask routes → Risk notifications: sends live alerts
app.py - Risk notifications → Email delivery: sends messages
utils/email_alert.py - Email delivery → Email recipients: delivers email
README.md - Flask routes → PDF reports: generates PDF
README.md - Live session manager → Web pages: serves live preview and stats
README.md - Uploaded video processing → History and analytics: provides risk timeline