This is a simple and modular face recognition project using OpenCV and Local Binary Patterns Histogram (LBPH). It allows you to:
- πΈ Collect face data using your webcam
- π§ Train an LBPH face recognizer on the collected dataset
- ποΈβπ¨οΈ Run real-time face recognition on webcam feed
Face Recognition/
βββ Dataset_creation.py # Capture and save face images
βββ Training.py # Train LBPH face recognizer
βββ Recognition.py # Perform real-time face recognition
βββ main.py # Orchestrates the full
---
## π§ Requirements
Install Python packages via pip:
```bash
pip install -r requirements.txt
You mainly need:
opencv-python
python main.pyFollow the CLI prompts to:
- Add the number of users
- Enter name & ID
- Capture 40 face images per person
- Train the model
- Start live recognition
- Captured images are saved in
face_dataset/<name>/ - Trained model is stored in
trainer.yml - You can adjust face recognition sensitivity by tweaking the confidence threshold in
Recognition.py
- Add GUI for easy usability
- Replace Haar cascades with DNN or Mediapipe
- Auto-save ID-name mapping for future reuse
- Add tests and evaluation metrics
- Deploy as a desktop or web app
Feel free to fork and contribute!