Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

face-recognitioniiti

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

face-recognitioniiti

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

  • 0.1.7
  • PyPI
  • Socket score

Maintainers
1

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

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc