The AI Surveillance System is an object detection and tracking application that uses YOLO (You Only Look Once) to detect people in a video feed and trigger alerts for suspicious activity such as loitering. The system is built using OpenCV, NumPy, and Pygame for real-time video processing and alert sound playback.
- Real-time person detection using YOLOv3-tiny.
- Tracks movement of detected persons.
- Detects loitering behavior and triggers an audio alert.
- Auto-stop feature to terminate after a set duration.
- Graceful exit with 'q' key press or keyboard interruption.
Ensure you have Python 3.x installed, then install the required dependencies:
pip install opencv-python numpy pygame- Download YOLOv3-tiny files:
- Place these files inside a
yolo/directory in the project folder.
Run the script to start the AI surveillance system:
python ai_surveillance.py- Press 'q' to quit the application.
- The system will auto-stop after a set duration (default: 60 seconds).
You can as well adjust parameters in the script:
| Parameter | Description | Default Value |
|---|---|---|
loitering_threshold |
Frames before loitering alert | 100 |
auto_stop_time |
Auto-stop time (seconds) | 60 |
alert_sound |
Path to alert sound file | "alert.mp3" |
├── yolo/
│ ├── yolov3-tiny.weights
│ ├── yolov3-tiny.cfg
│ ├── coco.names
├── alert.mp3
├── ai_surveillance.py
|__ sv.py
├── README.md
This project is licensed under the MIT License.
- YOLOv3: Joseph Redmon & Ali Farhadi
- OpenCV: OpenCV.org
🚀 Developed for AI-powered surveillance & security monitoring.