Skip to content

Repository files navigation

👁️ Face Recognition System

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.


📌 Overview

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:

  1. 📸 Capture face images
  2. 🧠 Train the face recognition model
  3. 🎥 Recognize faces in real time

✨ Features

  • 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

🛠️ Technologies Used

  • Python 🐍
  • OpenCV
  • OpenCV Contrib
  • NumPy
  • Haar Cascade Classifier
  • LBPH Face Recognition Algorithm

📂 Project Structure

Face-Recognition-System
│
├── face_dataset_capture.py
├── face_train.py
├── face_pred.py
├── haarcascade_frontalface_default.xml
├── requirements.txt
├── README.md
└── .gitignore

⚙️ Installation

Clone the repository:

git clone https://github.com/Sathyabyte/Face-Recognition-System.git

Install required libraries:

pip install -r requirements.txt

🚀 How It Works

1. Capture Face Dataset 📸

Run:

python face_dataset_capture.py

Enter the person's name and capture face images using the webcam.

The captured images are stored locally inside:

faces/
└── person_name/

2. Train the Model 🧠

Run:

python face_train.py

The 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

3. Face Recognition 🎥

Run:

python face_pred.py

The webcam will detect faces and display the recognized person's name.

Unknown faces are labelled as:

Unknown

🔒 Privacy Note

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.


🚀 Future Improvements

  • Improve recognition accuracy
  • Add deep learning-based face recognition
  • Add GUI interface
  • Build a face attendance system
  • Add database integration

👩‍💻 Author

Sathyabyte

BCA (Hons) Student | Data Science + AI/ML

About

Computer Vision project for real-time face recognition using OpenCV, Haar Cascade face detection, and LBPH machine learning algorithm.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages