Real-time person detection · loitering alerts · motion heatmaps
YOLOv8n runs at 4 fps on CPU; GPU accelerates to 30+ fps.
DeepSORT assigns stable IDs so people can be followed across occlusions.
Red bounding box + banner fires after ~37 s of stillness. Threshold is tunable.
A 36×48 grid accumulates activity; rendered as a JET colourmap overlay on end.
No desktop app — just open localhost:5000. Works on any OS.
Clean separation: core/tracker.py, heatmap.py, routes.py.
Clone the repo
git clone https://github.com/YOUR_USERNAME/surveillance-system.git
cd surveillance-system
Create a virtual environment & install deps
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
Start the server (weights auto-download on first run)
python app.py
Open in your browser
http://127.0.0.1:5000