|
|
||
|---|---|---|
| templates | ||
| .gitignore | ||
| README.md | ||
| camera_stream.py | ||
| extract_dataset.py | ||
| pipeline_config.py | ||
| requirements.txt | ||
| run_pipeline.py | ||
| split_dataset.py | ||
| train_model.py | ||
README.md
Surveillance Dashboard
Real-time multi-camera surveillance app with:
- Person detection using Ultralytics YOLO
- Group gathering detection (2+ people together)
- Alert when group duration is over 20 seconds
- Web dashboard with live feed, camera selector, and alert history
- GPU-only inference (CUDA required)
Features
- Switch between multiple cameras from UI
- Draw person boxes and group timer overlays
- Save alert snapshots to
alerts/ - Read camera credentials from
.env
Project Structure
camera_stream.py- backend stream processing, detection, and APItemplates/dashboard.html- dashboard UIrequirements.txt- minimal Python dependencies.env- credentials and camera IPsalerts/- captured alert images
Requirements
- Python 3.11+ (3.14 can work but ecosystem support may vary)
- NVIDIA GPU + CUDA drivers
- RTSP cameras reachable from this machine
- Utopia VPN access to reach the camera network
Setup
Create and activate virtual environment:
python -m venv .venv
.\.venv\Scripts\Activate.ps1
Install PyTorch with CUDA (recommended command from PyTorch site):
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu124
Install project dependencies:
pip install -r requirements.txt
Environment Variables
Create .env in project root:
username=YOUR_CAMERA_USERNAME
password=YOUR_CAMERA_PASSWORD
camera_ip_1=192.168.x.x
camera_ip_2=192.168.x.x
To add more cameras, add more camera_ip_* keys and update code list size if needed.
Run
.\.venv\Scripts\python camera_stream.py
Open:
Notes
- App is configured to require CUDA GPU; it will exit if CUDA is not available.
- Alert condition: at least 2 people in a group for 20+ seconds.
- Alert snapshots are stored in
alerts/. - Utopia VPN is required to access camera streams from outside the office network.
- For VPN or camera network access, contact Samad (IT Department, Head Office).