How jairajreddy/crowd_detection_-aiml works
AI Crowd Analytics is a Flask surveillance application: users view a live webcam stream or upload a video, then see crowd statistics, a heatmap, and a downloadable text report. The upload route coordinates video processing and each analysis output; live detection is served separately through streaming and count routes. A separate PyTorch dataset/model training workflow is also present, but the sampled application code does not connect it to runtime inference. The graph follows explicit calls and README-described capabilities; unsampled UI wiring is omitted.
Main entry points: app.py Flask routes · heatmap_generator.py Heatmap generator · yolo_stream.py Webcam stream · train.py Training workflow
Components 15
Web application
- Flask routes
app.py - Web pages
templates - Uploaded videos
static
Live detection
- Webcam stream
yolo_stream.py - YOLO detector
Video analysis
- Video processor
video_processor.py - Summary builder
analytics.py - Heatmap generator
heatmap_generator.py - Report generator
report_generator.py - Heatmap image
static - Text report
static
Model training
- Crowd dataset
dataset.py - Crowd counter
model.py - Training workflow
train.py
Other components
- User
Connections 17
- User → Flask routes: uses
README.md - Flask routes → Web pages: renders
app.py - Flask routes → Webcam stream: streams frames
app.py - Flask routes → Webcam stream: reads count
app.py - User → Flask routes: uploads video
app.py - Flask routes → Uploaded videos: saves video
app.py - Flask routes → Video processor: processes video
app.py - Video processor → YOLO detector: runs inference
video_processor.py - Flask routes → Summary builder: builds summary
app.py - Flask routes → Heatmap generator: generates heatmap
app.py - Heatmap generator → YOLO detector: runs inference
heatmap_generator.py - Heatmap generator → Heatmap image: writes image
heatmap_generator.py - Flask routes → Report generator: generates report
app.py - Report generator → Text report: writes report
report_generator.py - Webcam stream → YOLO detector: runs inference
yolo_stream.py - Training workflow → Crowd dataset: loads data
train.py - Training workflow → Crowd counter: trains model
train.py