Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real-Time Face Recognition

A real-time face detection and recognition pipeline using Python and OpenCV. Collects face samples from webcam, trains an LBPH recognizer, and runs live recognition. College project (2024).

What I Built

A complete face recognition system with three stages: data collection (captures and saves face crops from webcam), training (builds an LBPH model from collected faces), and live recognition (detects and identifies faces in real-time video with confidence scores).

Project Structure

face-recognition-opencv/
|-- src/
|   |-- collect_faces.py         # Capture face samples from webcam
|   |-- train_model.py           # Train LBPH recognizer
|   |-- recognize_live.py        # Real-time face recognition
|   |-- face_utils.py            # Shared utilities (detection, drawing)
|-- dataset/                     # Face images organized by person name
|-- models/
|   |-- face_recognizer.yml      # Trained LBPH model
|   |-- labels.txt               # Label-to-name mapping
|-- tests/
|   |-- test_utils.py            # Unit tests
|-- docs/
|   |-- how_it_works.md          # Technical explanation
|-- requirements.txt
|-- .gitignore
|-- README.md

How to Run

Step 1: Install Dependencies

pip install -r requirements.txt

Step 2: Collect Face Samples

python src/collect_faces.py --name YourName --samples 50

Opens webcam, detects your face, and saves 50 cropped grayscale images.

Step 3: Train the Recognizer

python src/train_model.py

Trains an LBPH model on all collected faces and saves it.

Step 4: Run Live Recognition

python src/recognize_live.py

Opens webcam and identifies faces in real-time. Shows name and confidence. Press 'q' to quit.

Tech Stack

  • Python, OpenCV (Haar Cascades + LBPH Face Recognizer)
  • NumPy

Author

Pathi Manikanta

  • B.E. Computer Science & Engineering (Data Science), Anna University, 2025

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages