Skip to main content

A package that contains a Real-time Face Recognition System.

Project description

Real-time Face Recognition System | DEMO

A Python-based real-time face recognition system that combines YOLO face detection with ArcFace embeddings for accurate face recognition. The system processes webcam feed in real-time, detecting faces and matching them against a stored database of known faces.

Features

  • Real-time face detection using YOLO
  • Face recognition using ArcFace embeddings
  • Persistent storage of face embeddings
  • Interactive interface for adding new faces to the database
  • Configurable confidence thresholds for detection and recognition
  • Live display of recognition results with bounding boxes and names

Prerequisites

  • Python 3.8 or higher
  • Webcam or camera device

Installation

  1. Clone this repository:
git clone https://github.com/Warlord-K/InterIIT-facerecognition.git
cd InterIIT-facerecognition
  1. Install required packages:
pip install -r requirements.txt
  1. Download the Arcface model: Click this link and put it in the same folder as the script

Usage

  1. Run the main script:
python face_recognition_system.py
  1. Controls:
  • Press 'q' to quit the application
  • Press 'a' to add a new face to the database
    • When prompted, enter the name for the face
    • The current frame will be used to generate embeddings

Configuration

You can modify the following parameters in the FaceRecognitionSystem class initialization:

face_system = FaceRecognitionSystem(
    database_path="face_database.pkl",  # Path to store face embeddings
    confidence_threshold=0.5,           # Minimum confidence for YOLO detection
    similarity_threshold=0.6            # Maximum distance for face recognition match
)

System Architecture

The system consists of three main components:

  1. Face Detection (YOLO)

    • Uses YOLO model optimized for face detection
    • Processes each frame to locate faces
    • Applies confidence threshold to filter detections
  2. Face Recognition (ArcFace)

    • Generates embeddings for detected faces
    • Compares embeddings with stored database
    • Returns closest match based on similarity threshold
  3. Database Management

    • Stores face embeddings with associated names
    • Supports adding new faces during runtime
    • Persists data between sessions using pickle

Performance Considerations

  • Processing speed depends on:
    • Hardware capabilities (CPU/GPU)
    • Image resolution
    • Number of faces in the database
  • Adjust confidence and similarity thresholds for optimal balance between accuracy and speed

Troubleshooting

Common issues and solutions:

  1. No camera access:

    • Check if camera is properly connected
    • Verify camera permissions
    • Try changing camera index in cv2.VideoCapture(0)
  2. Poor recognition accuracy:

    • Adjust similarity_threshold for stricter/looser matching
    • Ensure good lighting conditions
    • Add multiple embeddings per person under different conditions
  3. Slow performance:

    • Reduce frame resolution
    • Increase confidence threshold to process fewer detections
    • Consider using GPU acceleration if available

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

face_recognitioniiti-0.1.7.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

face_recognitioniiti-0.1.7-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file face_recognitioniiti-0.1.7.tar.gz.

File metadata

  • Download URL: face_recognitioniiti-0.1.7.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for face_recognitioniiti-0.1.7.tar.gz
Algorithm Hash digest
SHA256 cd2cebabab02d9ad018c8951d73c8edd85c10ac312fd670ac6f57996976b89fb
MD5 572e96652dbe008c0c64174d124fbd1f
BLAKE2b-256 a22fa43d2563ca383a417c986d5874d20a4f00dd5caefac54c766c6fb7c1bc33

See more details on using hashes here.

File details

Details for the file face_recognitioniiti-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for face_recognitioniiti-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 fe4c1d659164007c147982fe91f27b01987a9bb216ef7d5a394ef59422615882
MD5 08937559c48147ff35d9a0b0e498202f
BLAKE2b-256 4862caa26a5796fda841320b569e2a48004acd03f2095d2670b9b132fcabf215

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page