A robust real-time face tracking system with multi-camera support, facial recognition, age & gender detection, and intelligent alerting capabilities including Telegram notifications.
- Multi-Camera Support: Simultaneously monitor multiple video sources (webcams, RTSP streams, video files)
- Real-Time Face Detection: Powered by InsightFace with GPU acceleration support
- Face Recognition: Identify known individuals with configurable confidence thresholds
- Age & Gender Detection: Estimate demographic attributes for each detected face
- β¨ Telegram Notifications: Get instant alerts with snapshots on your phone
- π Visual & Audio Alerts: Customizable popups and sound notifications
- πΈ Automatic Evidence Capture: Saves screenshots of recognition events
- π Comprehensive Logging: Detailed event records with timestamps and confidence levels
- π₯οΈ Live Monitoring Dashboard: View all camera feeds in real-time
- π€ Face Management: Add/remove known faces with photo uploads
- β±οΈ History Viewer: Filter events by date, camera, or individual
Component | Technology Used |
---|---|
Face Detection | InsightFace |
Machine Learning | PyTorch |
Computer Vision | OpenCV |
GUI Framework | PyQt5 |
Database | SQLite |
Audio Alerts | Pygame |
Telegram Alerts | python-telegram-bot |
Alert Channels | Telegram Bot |
Demographics | Age & Gender via InsightFace |
- Python 3.8+
- NVIDIA GPU (recommended for best performance)
- FFmpeg (for RTSP streams)
-
Clone the repository:
git clone https://github.com/AarambhDevHub/multi-cam-face-tracker.git cd multi-cam-face-tracker
-
Create virtual environment:
python -m venv venv source venv/bin/activate # Linux/Mac venv\Scripts\activate # Windows
-
Install dependencies:
pip install -r requirements.txt
-
Configure the system:
- Edit
config/config.yaml
for application settings - Edit
config/camera_config.yaml
for camera configurations
- Edit
-
Directory setup:
mkdir -p data/{known_faces,screenshots} config logs
-
Run the application:
python main.py
app:
name: "Multi-Cam Face Tracker"
version: "1.0.0"
threshold: 0.6
screenshot_dir: "data/screenshots"
known_faces_dir: "data/known_faces"
database_path: "data/database.db"
alert_sound: "assets/alert.wav"
log_dir: "logs"
recognition:
detection_threshold: 0.5
recognition_threshold: 0.6
max_batch_size: 8
device: "cpu" # or "cuda"
age_estimation: true
gender_detection: true
cameras:
- id: 0
name: "Front Camera"
source: 0 # Camera index or RTSP URL # Camera index or "rtsp://..."
enabled: true
resolution:
width: 1280
height: 720
fps: 30
rotate: 0 # Degrees (0,90,180,270)
telegram:
enabled: true
bot_token: "YOUR_BOT_TOKEN" # From @BotFather
chat_id: "YOUR_CHAT_ID" # Get from @getidsbot
rate_limit: 30 # Seconds between alerts
- Create bot with @BotFather
- Get chat ID with @getidsbot
- Add bot to your alert channel as admin
- Enable in config and restart app
Want to dive deeper into how this system works, including architecture insights and real-world deployment tips? π Explore the project on DeepWiki: π https://deepwiki.com/AarambhDevHub/multi-cam-face-tracker
- Click "Face Manager" in the Tools menu
- Select "Add Face" and upload a clear photo
- Enter the person's name and save
Button Functionality
βΆοΈ Start Activates selected camera feed
βΉοΈ Stop Halts camera processing
βοΈ Settings Adjust resolution/FPS
- Configure sound preferences in Alert Panel
- Set minimum confidence threshold (0.5-1.0)
- Enable/disable screenshot capture
- View age and gender next to each recognized face
-
For RTSP Streams:
- Use tcp transport protocol for stability
- Example:
rtsp://user:pass@ip:port/stream?tcp
-
GPU Acceleration:
recognition: device: "cuda" # In config.yaml
-
Optimization:
- Lower processing intervals for fewer cameras
- Reduce resolution for distant facial recognition
- Use JPEG compression for RTSP streams
- Office Security: Monitor entrances for unauthorized personnel
- Smart Home: Get alerts when family members arrive
- Retail Analytics: Track customer demographics
MIT License - See LICENSE for details.
We welcome contributions! Please see our Contribution Guidelines
If you find this project helpful, consider buying me a coffee! Buy Me a Coffee