https://github.com/harizonelopez/face-detector
This project is a real-time face detection application using OpenCV's deep learning-based face detector. It captures faces from a webcam feed, detects faces with high accuracy using a pre-trained Caffe model, and saves the detected faces as image files labeled with the user's name.
https://github.com/harizonelopez/face-detector
cdn dnn numpy opencv python3
Last synced: about 2 months ago
JSON representation
This project is a real-time face detection application using OpenCV's deep learning-based face detector. It captures faces from a webcam feed, detects faces with high accuracy using a pre-trained Caffe model, and saves the detected faces as image files labeled with the user's name.
- Host: GitHub
- URL: https://github.com/harizonelopez/face-detector
- Owner: harizonelopez
- Created: 2025-06-03T09:54:17.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-09-27T13:19:28.000Z (9 months ago)
- Last Synced: 2025-09-27T15:17:21.765Z (9 months ago)
- Topics: cdn, dnn, numpy, opencv, python3
- Language: Python
- Homepage: https://github.com/harizonelopez/Face-detector
- Size: 9.45 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Real-Time Face Detection System
This project demonstrates real-time face detection using OpenCV's DNN (Deep Neural Network) module and a pre-trained Caffe model. It captures video from your webcam, detects faces in each frame, and displays bounding boxes and confidence scores.
---
## 📸 Demo
*Example only. Actual live webcam will be used.*
---
## ⚙️ Requirements
Make sure you have the following installed:
- Python 3.6+
- flask 3.1+
- OpenCV with DNN module
- NumPy
- setuptools
You can install the dependencies with:
```bash
pip install -r requirements.txt
```
---
## Activate the virtual environment
### On Windows (PowerShell)
```bash
venv\scripts\activate
```
### On macOS/Linux
```bash
source venv/bin/activate
```
---
## 🧠 Model Details
This project uses a deep learning model based on a ResNet10 SSD (Single Shot Multibox Detector) architecture.
### Download the required files:
```bash
`deploy.prototxt`
`res10_300x300_ssd_iter_140000.caffemodel`
```
#### Rename or place them in the same folder as:
```bash
face_model.caffemodel
deploy.prototxt
```
---
## 🚀 How to Run
```bash
python face_detection.py
```
Press `q` to quit the webcam window.
---
## 🎯 Features
- ✅ Real-time face detection from webcam
- ✅ Confidence score display
- ✅ Bounding boxes around detected faces
- ✅ Frames-per-second (FPS) calculation
- ✅ Input validation (model file and webcam check)
- ✅ Auto-clamping to prevent frame-bound errors
- ✅ Train LBPH face recognizer
- ✅ Recognize faces live from webcam
---
## 📌 Notes
- Works best in well-lit environments.
- Accuracy threshold can be modified from `confidence > 0.5` in the `face_detector.py`.
---
## 👨💻 Author
- GitHub: @harizonelopez
- Email: @harizonelopez23@gmail.com
---
## 📜 License
MIT License
---