Security System is an advanced AI-powered surveillance platform that transforms any camera into an intelligent monitoring station. Built with cutting-edge computer vision technologies, it provides real-time person detection, facial recognition, motion analysis, and instant alerts—all controllable from your Telegram app.
The system combines YOLOv8 for accurate person detection, MediaPipe for skeleton tracking, and face_recognition for trusted person identification. When an intruder enters a defined security zone, the system immediately triggers alarms, captures evidence, and sends notifications to your phone.
Key Capabilities:
- 🎯 Zero false positives with YOLOv8 neural network detection
- 🦴 Full skeleton tracking detects partial body intrusions (hands, feet, etc.)
- 👤 Trusted person recognition automatically disarms for known faces
- 📱 Complete Telegram control with inline buttons and real-time status
- 🔥 Motion heat mapping visualizes activity patterns over time
- 🎨 Professional GUI with night vision, recording, and zone drawing
Detection Pipeline Explained:
-
Frame Capture — Camera feed is captured at up to 30 FPS with configurable resolution (default 1280×720)
-
Preprocessing — Frames are resized and normalized for optimal neural network performance
-
Parallel Detection — Three detection modules run simultaneously:
- YOLOv8 identifies person bounding boxes with confidence scores
- MediaPipe Pose extracts 33 skeleton landmarks for each detected person
- Face Recognition matches faces against the trusted database
-
Detection Fusion — Results are merged to create comprehensive person profiles including:
- Bounding box coordinates
- Skeleton joint positions
- Partial body detections (hands, feet, torso)
- Face identity and trust status
-
Zone Analysis — Each detection is checked against defined security zones:
- Full body overlap detection
- Individual landmark breach checking
- Partial body intrusion detection
- Motion-correlated breach verification
-
Alert Dispatch — When breach is confirmed:
- Alarm sound triggers immediately
- TTS announces the intrusion
- Snapshot is captured and saved
- Telegram notification sent with photo
- Database logs the event
| 🧠 Core Engine | Module | Technology | Function |
|---|---|---|---|
main.pygui.pyconfig.py |
Person Detection | YOLOv8 | Neural network person detection with confidence scoring |
| Skeleton Tracking | MediaPipe | 33-point pose estimation for partial body detection | |
| Face Recognition | face_recognition | Trusted person identification with auto-processing | |
| 📡 Communication | Module | Protocol | Function |
telegram_bot.pyaudio.py |
Remote Control | Telegram API | Inline buttons, live snapshots, instant alerts |
| Audio Alerts | pyttsx3 + pygame | Text-to-speech announcements and alarm sounds | |
| 💾 Data Layer | Module | Storage | Function |
database.pyutils.py |
Event Logging | SQLite | Persistent storage for events and daily statistics |
| Zone Management | Memory | Polygon geometry, 3D rendering, breach detection |
Prerequisites:
- Python 3.10 or higher
- Webcam or IP camera
- Telegram account (for remote control)
Step 1: Clone the Repository
git clone https://github.com/Binivert/Security-System.git
cd Security-SystemStep 2: Create Virtual Environment
python -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # WindowsStep 3: Install Dependencies
pip install -r requirements.txtStep 4: Configure Telegram Bot
- Create a bot via @BotFather on Telegram
- Copy your bot token
- Get your chat ID from @userinfobot
- Update
config.pywith your credentials:
TELEGRAM_BOT_TOKEN = "your_bot_token_here"
TELEGRAM_CHAT_ID = "your_chat_id_here"Step 6: Add Trusted Faces (Optional)
Place photos of trusted persons in the trusted_faces/ folder. The system will automatically process them on startup.
Starting the System:
python main.py| 🖥️ GUI Controls | 📱 Telegram Commands | ⌨️ Keyboard Shortcuts | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
Security-System/
├── main.py # Application entry point
├── gui.py # PyQt6 GUI and main logic
├── config.py # Configuration settings
├── detectors.py # YOLOv8, MediaPipe, face recognition
├── telegram_bot.py # Telegram bot integration
├── audio.py # TTS and alarm system
├── database.py # SQLite event logging
├── utils.py # Zone management utilities
├── requirements.txt # Python dependencies
├── trusted_faces/ # Trusted person photos
├── recordings/ # Saved video recordings
├── snapshots/ # Captured snapshots
└── alerts/ # Alert evidence photos
Untitled.video.-.Made.with.Clipchamp.mp4
Real-time alerts, snapshots, and full system control directly from your phone
