This project is an AI-powered smart zone monitoring system designed for security applications.
Instead of complex action recognition, it detects unauthorized presence in predefined restricted areas.
- Lightweight and fast compared to full action recognition.
- Easier deployment for real-world setups.
- Works seamlessly with static surveillance cameras.
- Real-time video processing with support for files, RTSP streams, and camera inputs.
- Multi-threaded architecture for optimized performance.
- Intrusion detection in marked zones.
- Configurable detection areas for flexible security setups.
- Real-time alerts and notifications.
- 🔄 (Planned) API for easy integration.
- 🔄 (Planned) Edge device deployment for low-power efficiency.
- Clone the repository:
git clone https://github.com/fw7th/AnomalyDetection.git cd AnomalyDetection - Install dependencies:
pip install -r requirements.txt
- Set up environment variables with notifications:
- Create a
.envfile with your email credentials - Configure Twilio credentials in
AnomalyDetection/config/keys/twilio.txt.
- Create a
Basic usage:
python main.py --source /path/to/video.mp4 --enable-saving --output output.mp4Run the script on the provided sample video
python main.py --source ../examples/sample.mp4Camera input:
python main.py --source 0RTSP stream:
python main.py --source rtsp://your-stream-urlWith email notifications:
python main.py --source 0 --email you@example.comWith SMS notifications:
python main.py --source 0 --phone +1234567890With a path for saved video:
python main.py --source 0 --enable-saving --output /your/save/path.mp4With selected detection accuracy:
python main.py --source 0 --accuracy 2- Define restricted zones on the surveillance feed.
- Detect intrusions inside the marked areas.
- Trigger alerts and log unauthorized access.
- Zone setup:
scripts/draw_zones.py - System parameters:
config/settings.py
This system uses a modular pipeline:
- Frame Acquisition — Capture frames from source.
- Preprocessing — Prepare frames for detection.
- Detection — AI-driven analysis.
- Display/Output — Visualization and output saving.
-
Optimize model for real-time processing.
-
Deploy a cloud-based API version.
-
Improve detection accuracy and lower false positives.
-
Integrate facial recognition for authorized faces.
This project is open-source under MIT License.