Skip to content

swapno10/FACE_RECOGNITION

Repository files navigation

Real-Time Face Recognition System

This project is a Python-based real-time face recognition system that detects, encodes, and identifies human faces using a webcam. Built using powerful libraries like OpenCV, MediaPipe, and face_recognition, the system performs accurate detection and recognition with additional features such as logging, screenshot capture, and sound alerts.


Features

  • Real-time face detection using MediaPipe
  • 128-dimensional face encoding using face_recognition
  • Save face data as .npy files
  • Recognize and label known faces from dataset
  • Logs every successful recognition with timestamp and confidence
  • Automatically captures screenshots of recognized faces
  • Displays number of known individuals and watermark
  • Optional sound alert on successful recognition

Tech Stack

  • Python 3.x
  • OpenCV
  • MediaPipe
  • face_recognition
  • NumPy
  • playsound or pygame (for optional sound)

Folder Structure

project/ ├── Face_Data.py # Script to collect face encodings ├── Face_Recognition.py # Real-time face detection & recognition ├── face_dataset/ # Stores .npy encoding files ├── screenshots/ # Captured images of recognized faces ├── logs/ # Log of recognized faces ├── .gitignore # Git ignore rules └── README.md # This file


How to Use

  1. Collect Face Data Run the following script and follow on-screen instructions:
python Face_Data.py
a) Look into the webcam
b)Press s to stop when enough data is collected

2. Run Real-Time Face Recognition
python Face_Recognition.py
a) The system will identify any known face
b) Logs and screenshots will be saved automatically
c) Press s to stop the recognition

Requirements
Install dependencies:
pip install opencv-python face_recognition mediapipe numpy playsound
For sound support, ensure beep.wav is placed in the project directory.

Notes
Works best in good lighting
.npy files and logs are ignored from Git using .gitignore
Easy to extend for video file input, GUI, or mobile integration

Credits
Developed by Swapno
Inspired by clean Python practices, real-world deployment needs, and a love for knowledge.

About

A real-time face recognition system with live webcam input, encodings, logging, and screenshot capture — built with OpenCV and MediaPipe.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages