This project is like a smart doorman for your computer. Whenever someone shows up in front of your webcam, it will:
- 👀 Detect their face in real time
- 📸 Take a snapshot and save it locally
- 🔔 Play an alert sound
- 📧 Optionally send you an email with the snapshot attached
- 📱 Optionally send you a desktop notification or Pushbullet alert
So basically, it watches your door (or screen) for you and notifies you if someone's there.
- Real-time Face Detection using face_recognition
- Snapshot Saving to your
~/Pictures/FDS_Snapshots/directory - Email Alerts (with snapshot attached)
- Desktop Notifications (via Plyer)
- Push Notifications with Pushbullet
- Alert Sound whenever a face is detected
Make sure you've got these packages installed:
- Python 3.10+
- OpenCV (
cv2) setuptoolsface_recognitionplaysound3plyerpushbullet.pypython-dotenv
First setup a Virtual Environment (highly recommended):
python3 -m venv <venv_name>
source <venv_path>/bin/activateThen, install the requirements with:
pip install opencv-python setuptools face_recognition playsound3 plyer pushbullet.py python-dotenv
⚠️ Note: the above packages may require extra system dependencies (dlib, cmake). Check their docs if installation gives you errors.
-
Clone this repo.
-
Create a
.envfile in the project root with your email/Pushbullet settings:SERVER=smtp.gmail.com PORT=587 EMAIL_NAME=[email protected] PASSWORD=your-app-password MAIL=[email protected] ACCESS_TOKEN=your_pushbullet_token
For Gmail, you'll need an App Password, not your normal login password.
-
Make sure
./sound/alert.wavexists (replace with your own sound if you want).
Run it using:
cd src/ # Move into the src directory
python main.py # Run the scriptThe webcam window will open up.
Press q to quit at any time.
Inside the script, you can toggle these options:
send_email = True # Send email with snapshot
send_notification = True # Send local desktop notification
send_alert = True # Play sound and send alerts (This needs to be True to send notifications)
push = True # Send Pushbullet notificationSet them to False if you don't need them.
All snapshots are saved automatically to:
~/Pictures/FDS_Snapshots/ #/home/<user_name>/Pictures/FDS_Snapshots/Filenames look like:
fds_snapshot_2025-08-18_12:34:56.png- Add face recognition (to differentiate between family and strangers).
- Hook into IoT devices (unlock your smart door, turn on lights, etc.).
- Mobile app integration.
This project is for personal / educational use only. Don't rely on it as your only home security system.
MIT License. Do whatever you want, just don’t claim you made it from scratch if you didn’t. Be chill.