How lewjiayi/crowd-analysis works
Crowd-Analysis processes CCTV or video frames into person detections, persistent tracks, crowd-rule checks, and recorded movement/crowd data. Separate scripts turn those records into abnormal-energy summaries, heatmaps and optical flow, and time-series crowd summaries. The sampled source establishes the main processing and Deep SORT relationships; downstream report links are documented in the README, while some report implementations were not sampled.
Main entry points: main.py Processing entry point · tracker.py Track manager · video_process.py Frame processing · tracking.py Person detection
Components 20
Video processing
- Runtime settings
config.py - Processing entry point
main.py - Frame processing
video_process.py
Detection and tracking
- Person detection
tracking.py - Appearance encoder
deep_sort/generate_detections.py - Detection records
deep_sort/detection.py - Track manager
deep_sort/tracker.py - Track assignment
deep_sort/linear_assignment.py - Motion filter
deep_sort/kalman_filter.py - Track state
deep_sort/track.py - IoU matching
deep_sort/iou_matching.py - Feature matching
deep_sort/nn_matching.py
Crowd analytics
- Distance violations
video_process.py - Restricted entry
video_process.py - Abnormal activity
video_process.py - Processed CSV and JSON
main.py
Data products
- Energy summary
abnormal_data_process.py - Movement summary
movement_data_present.py - Heatmap and flow
crowd_data_present.py
Other components
- Video operator
Connections 21
- Video operator → Runtime settings: sets inputs
README.md - Runtime settings → Processing entry point: configures
main.py - Processing entry point → Frame processing: processes video
main.py - Processing entry point → Appearance encoder: creates encoder
main.py - Processing entry point → Feature matching: creates metric
main.py - Processing entry point → Track manager: creates tracker
main.py - Frame processing → Person detection: requests detections
video_process.py - Person detection → Appearance encoder: extracts features
tracking.py - Person detection → Detection records: builds detections
tracking.py - Person detection → Track manager: updates tracks
tracking.py - Track manager → Track assignment: assigns detections
deep_sort/tracker.py - Track manager → IoU matching: matches by IoU
deep_sort/tracker.py - Track manager → Motion filter: filters motion
deep_sort/tracker.py - Track manager → Track state: updates state
deep_sort/tracker.py - Frame processing → Distance violations: checks proximity
video_process.py - Frame processing → Restricted entry: checks entry
video_process.py - Frame processing → Abnormal activity: checks energy
video_process.py - Processing entry point → Processed CSV and JSON: writes records
main.py - Processed CSV and JSON → Energy summary: summarizes energy
README.md - Processed CSV and JSON → Movement summary: plots metrics
README.md - Processed CSV and JSON → Heatmap and flow: derives heatmap and flow
README.md