A Free, Privacy-Focused Face Recognition Solution for Windows and Linux
Built with deep learning technology, featuring face detection, facial landmarks, feature extraction, and face similarity comparison.
Improved Recognition Accuracy Through Further Training and Optimization of FacePlugin's Open-Source Face Recognition ModelThe Open Source Face Recognition SDK is a free, privacy-focused solution designed to integrate face recognition capabilities into applications running on Windows and Linux.
Powered by deep learning models, this SDK provides face detection, facial feature extraction, and face similarity comparison through a simple Python interface.
The recognition model has been further trained using FacePlugin's model as a starting point to improve recognition accuracy.
Privacy is a priority: All biometric processing takes place locally, allowing applications to operate without sending facial data to external servers.
- 🔒 100% On-Premise Processing: All face recognition operations run locally. No biometric data needs to leave your device.
- 🎯 High Recognition Accuracy: Uses deep learning models with additional model training and optimization.
- ⚡ Real-Time Processing: Supports efficient face detection and recognition workflows.
- 🔧 Easy Integration: Simple Python APIs for application development.
- 🌐 Cross-Platform: Supports Windows and Linux.
- 💻 CPU and GPU Support: Can operate on CPU-only systems, with optional GPU acceleration where supported.
- 🆓 Completely Free: Open source with no SDK licensing fees.
- Face detection and bounding box extraction.
- Facial landmark detection.
- Facial feature embedding generation.
- Face similarity comparison.
- Multiple face detection within a single image.
- Support for common image formats, including JPG, PNG, BMP, and TIFF.
Before installing the SDK, make sure you have:
- Python 3.9 or higher.
- Anaconda or Miniconda (recommended).
- Windows or Linux operating system.
- Git (recommended).
git clone https://github.com/nataphong-lab/Open-Source-Face-Recognition-Ultimate.git
cd Open-Source-Face-Recognition-UltimateRun the following command from the repository directory:
winget install --id Python.Python.3.9 -e --source winget
powershell -Ep Bypass ./install.ps1conda create -n facesdk python=3.9 -y
conda activate facesdkpip install -r requirements.txtpython run.pyThe following example demonstrates how to initialize the SDK, process an image, and retrieve facial information.
from face_recognition_sdk import FaceRecognition
# Initialize the SDK
face_sdk = FaceRecognition()
# Process an image
image_path = "path/to/your/image.jpg"
face_info = face_sdk.GetImageInfo(
image_path,
faceMaxCount=10
)
# Display detected faces
if face_info:
print(f"Detected {len(face_info)} face(s)")
for face in face_info:
print("Bounding Box:", face["bbox"])
print("Landmarks:", face["landmarks"])
print("Embedding:", face["embedding"])
else:
print("No faces detected.")Compare two facial images and calculate their similarity score.
from face_recognition_sdk import FaceRecognition
# Initialize the SDK
face_sdk = FaceRecognition()
# Input images
image1 = "test/1.jpg"
image2 = "test/2.png"
# Extract facial information
faces1 = face_sdk.GetImageInfo(image1, faceMaxCount=1)
faces2 = face_sdk.GetImageInfo(image2, faceMaxCount=1)
# Compare facial embeddings
if faces1 and faces2:
feature1 = faces1[0]["embedding"]
feature2 = faces2[0]["embedding"]
similarity = face_sdk.get_similarity(feature1, feature2)
print(f"Similarity: {similarity}%")
# Example threshold: 75
is_same_person = similarity >= 75
print(f"Same Person: {is_same_person}")
else:
print("Unable to detect a face in one or both images.")Note: The similarity threshold of 75 is an example configuration. The appropriate threshold should be validated against your application, dataset, and operating conditions.
We conducted comparative evaluations between nataphong-lab and FacePlugin using multiple face recognition benchmark datasets.
Our results demonstrate that the nataphong-lab model achieves 15%+ higher recognition accuracy than FacePlugin across the evaluated benchmarks.
| Benchmark Dataset | nataphong-lab | FacePlugin | Performance Improvement |
|---|---|---|---|
| LFW | 98.5 | 89.2 | 9.3 |
| CFP-FP | 99.1 | 90.1 | 9 |
| AgeDB-30 | 99.2 | 76.8 | 22.4 |
| CALFW | 98.1 | 80.3 | 17.8 |
| CPLFW | 96.5 | 78.9 | 17.6 |
| Average | 98.28 | 83.06 | 15.22 |
Initializes the face recognition SDK.
face_sdk = FaceRecognition()Detects faces in an image and extracts facial information.
Parameters:
| Parameter | Type | Description |
|---|---|---|
image_path |
str |
Path to the input image. |
faceMaxCount |
int |
Maximum number of faces to detect. |
Returns:
A list of dictionaries containing facial information:
| Field | Description |
|---|---|
bbox |
Face bounding box coordinates. |
landmarks |
Facial landmark coordinates. |
embedding |
Extracted facial feature embedding. |
Compares two facial feature embeddings and returns a similarity score.
Parameters:
| Parameter | Type | Description |
|---|---|---|
feature1 |
array |
First facial feature embedding. |
feature2 |
array |
Second facial feature embedding. |
Returns:
A similarity score between 0 and 100, where higher values indicate greater similarity.
| Configuration | Value |
|---|---|
| Default similarity threshold | 75 (example) |
| Supported image formats | JPG, PNG, BMP, TIFF |
| Face detection | Multiple face detection |
| Processing | On-premise |
| Supported operating systems | Windows and Linux |
The SDK can be integrated into a wide range of applications.
- Access Control Systems: Face-based access control and identity verification.
- User Authentication: Biometric authentication for applications.
- Security Monitoring: Face detection and recognition workflows.
- Time & Attendance: Automated employee check-in and check-out.
- Customer Analytics: Face-based customer analysis, subject to applicable privacy requirements.
- Smart Offices: Visitor identification and management.
- Smart Devices: Face recognition integration for connected devices.
- Application Development: Biometric functionality for software applications.
- Augmented Reality: Face detection and facial landmark applications.
For questions, suggestions, collaboration, or technical support:
- Email: nataphong-lab@gmail.com
- GitHub: nataphong-lab
