Skip to content

praveenh001/face-recognization-security-sysytem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ Face Recognition Surveillance with SMS Alerts

A Python-based home surveillance system that uses face recognition to detect known and unknown individuals in real-time via webcam. When an unknown person is detected, it starts video recording and sends an SMS alert to the specified phone number using Twilio.


πŸ“Œ Features

  • πŸ” Detects faces using face_recognition and classifies as known or unknown.
  • 🧠 Loads known faces from a directory and matches with live video feed.
  • πŸŽ₯ Automatically records video when an unknown face is detected.
  • πŸ“± Sends SMS alerts via Twilio when unknown faces appear.
  • βœ… Stops recording automatically after a few seconds of no unknown activity.
  • πŸ“‚ Saves recorded videos in a designated directory.

πŸ“ Project Structure

face-surveillance/
β”œβ”€β”€ known_faces/                  # Folder for known people's images
β”‚   β”œβ”€β”€ Alice/                    # Person 1
β”‚   β”‚   β”œβ”€β”€ alice1.jpg            # Image 1
β”‚   β”‚   └── alice2.png            # Image 2
β”‚   └── Bob/                      # Person 2
β”‚       └── bob.jpg               # Single image
β”‚
β”œβ”€β”€ unknown_videos/               # Auto-created recordings
β”‚   └── unknown_20231115_1430.avi # Example video filename
β”‚
β”œβ”€β”€ surveillance.py               # Main application script
β”œβ”€β”€ requirements.txt              # Python dependencies
└── README.md                     # Project documentation

βš™οΈ Setup Instructions

  1. πŸ“¦ Install Required Libraries: pip install face_recognition opencv-python numpy twilio

Note: face_recognition requires dlib which might need CMake and Visual Studio Build Tools on Windows.

  1. πŸ“ Add Known Faces: create a known faces foler and insert faces in folder of theor names
    known_faces/
    β”œβ”€β”€ John/
    β”‚   β”œβ”€β”€ john1.jpg
    β”‚   └── john2.jpg
    └── Alice/
        └── alice.jpg
  1. unknown_vedios folder will be automatically created if not exist

  2. πŸ” Configure Twilio: Replace the placeholders in the script:

    TWILIO_ACCOUNT_SID = "YOUR_ACCOUNT_SID"

    TWILIO_AUTH_TOKEN = "YOUR_AUTH_TOKEN"

    TWILIO_PHONE_NUMBER = "+1234567890"

    RECIPIENT_PHONE_NUMBER = "+91XXXXXXXXXX"

  3. ▢️ Run the Program:

     python surveillance.py
    

πŸ› οΈ Configuration

Variable Description Default
TOLERANCE Face matching tolerance (lower = stricter) 0.4
MIN_SIZE Minimum face size to be considered (pixels) 50
SMS_COOLDOWN SMS cooldown period (in seconds) 60 seconds
RECORD_BUFFER_SECONDS Time to keep recording after last unknown 5 seconds

For bugs or suggestions, open an issue or email:
πŸ“§ praveenpuni80@gmail.com
🌐 GitHub: @praveenh001

About

A Python-based home surveillance system that uses face recognition to detect known and unknown individuals in real-time via webcam. When an unknown person is detected, it starts video recording and sends an SMS alert to the specified phone number using Twilio.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages