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
- Clone this repository:
git clone https://github.com/Warlord-K/InterIIT-facerecognition.git
cd InterIIT-facerecognition
- Install required packages:
pip install -r requirements.txt
- Download the Arcface model: Click this link and put it in the same folder as the script
Usage
- Run the main script:
python face_recognition_system.py
- 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:
-
Face Detection (YOLO)
- Uses YOLO model optimized for face detection
- Processes each frame to locate faces
- Applies confidence threshold to filter detections
-
Face Recognition (ArcFace)
- Generates embeddings for detected faces
- Compares embeddings with stored database
- Returns closest match based on similarity threshold
-
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:
-
No camera access:
- Check if camera is properly connected
- Verify camera permissions
- Try changing camera index in
cv2.VideoCapture(0)
-
Poor recognition accuracy:
- Adjust
similarity_thresholdfor stricter/looser matching - Ensure good lighting conditions
- Add multiple embeddings per person under different conditions
- Adjust
-
Slow performance:
- Reduce frame resolution
- Increase confidence threshold to process fewer detections
- Consider using GPU acceleration if available
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd2cebabab02d9ad018c8951d73c8edd85c10ac312fd670ac6f57996976b89fb
|
|
| MD5 |
572e96652dbe008c0c64174d124fbd1f
|
|
| BLAKE2b-256 |
a22fa43d2563ca383a417c986d5874d20a4f00dd5caefac54c766c6fb7c1bc33
|
File details
Details for the file face_recognitioniiti-0.1.7-py3-none-any.whl.
File metadata
- Download URL: face_recognitioniiti-0.1.7-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe4c1d659164007c147982fe91f27b01987a9bb216ef7d5a394ef59422615882
|
|
| MD5 |
08937559c48147ff35d9a0b0e498202f
|
|
| BLAKE2b-256 |
4862caa26a5796fda841320b569e2a48004acd03f2095d2670b9b132fcabf215
|