A Computer Vision-based Face Recognition System built using Python and OpenCV. This project uses Haar Cascade for face detection and the LBPH (Local Binary Pattern Histogram) Face Recognizer for real-time face recognition through a webcam.
This project captures face images, trains a recognition model, and identifies registered faces in real time using a webcam.
The system follows three main steps:
- 📸 Capture face images
- 🧠 Train the face recognition model
- 🎥 Recognize faces in real time
- Real-time face detection using OpenCV
- Webcam-based face image collection
- Face recognition using LBPH algorithm
- Haar Cascade classifier for detecting faces
- Supports multiple registered users
- Detects unknown faces
- Python 🐍
- OpenCV
- OpenCV Contrib
- NumPy
- Haar Cascade Classifier
- LBPH Face Recognition Algorithm
Face-Recognition-System
│
├── face_dataset_capture.py
├── face_train.py
├── face_pred.py
├── haarcascade_frontalface_default.xml
├── requirements.txt
├── README.md
└── .gitignore
Clone the repository:
git clone https://github.com/Sathyabyte/Face-Recognition-System.gitInstall required libraries:
pip install -r requirements.txtRun:
python face_dataset_capture.pyEnter the person's name and capture face images using the webcam.
The captured images are stored locally inside:
faces/
└── person_name/
Run:
python face_train.pyThe training script:
- Loads captured face images
- Converts images into grayscale
- Assigns labels to users
- Trains the LBPH face recognizer
It generates:
face_model.yml
labels_face.pickle
Run:
python face_pred.pyThe webcam will detect faces and display the recognized person's name.
Unknown faces are labelled as:
Unknown
The face dataset and trained model files are not included in this repository.
Users can create their own face dataset using:
face_dataset_capture.py
This avoids uploading personal face images.
- Improve recognition accuracy
- Add deep learning-based face recognition
- Add GUI interface
- Build a face attendance system
- Add database integration
Sathyabyte
BCA (Hons) Student | Data Science + AI/ML