Quick Answer: The Open Source Face Recognition SDK from nataphong-lab is a free Python library for Windows and Linux. It detects faces, returns bounding boxes, landmarks, and feature embeddings, and scores similarity between two faces, with processing done locally. It builds on FacePlugin's open model, but its README doesn't document liveness detection or anti-spoofing.
Open source face recognition has moved from research demos to code you can clone and run in an afternoon. That's useful, but it also makes it easy to ship a biometric feature without understanding what it actually measures. The nataphong-lab repository is a good case study. It has a clean Python API, a headline accuracy claim, and a keyword list that promises more than the README delivers. Here's how to read it honestly.
What this open source face recognition SDK actually documents
The fastest way to evaluate any SDK is to separate what it documents from what its marketing implies. The repository description lists liveness detection, anti-spoofing, face pose, expression, attributes, and template extraction. The README's capability list covers a narrower set.
| Capability | Documented in README? | What you get |
|---|---|---|
| Face detection and bounding boxes | Yes | A bbox per face, up to faceMaxCount |
| Facial landmarks | Yes | Landmark coordinates per face |
| Feature embedding | Yes | A vector in the embedding field |
| Face similarity comparison | Yes | A 0–100 score from get_similarity() |
| Liveness or anti-spoofing | No | Not described anywhere in the README |
| Pose, expression, attributes | No | Not described anywhere in the README |
Here's the part most people miss: the embedding is your template. Many teams assume templates are a separate, specialised format. In this SDK, the vector returned by GetImageInfo is what you store and compare, so it's also the data you need to protect.
Reading the benchmark table without getting fooled
The headline claim is that the nataphong-lab model achieves "15%+ higher recognition accuracy" than FacePlugin. The table supports a narrower reading. The averages are 98.28 versus 83.06, a gap of 15.22 percentage points. Relative to FacePlugin's average, that's about 18% more accuracy. The claim holds up, but the number in the text and the number in the table aren't the same measure.
The largest gap is on AgeDB-30, at 22.4 points. That benchmark tests recognition across age variation, so it's the number most worth re-checking yourself.
Three caveats matter more than the arithmetic. First, the author produced these results. The README doesn't name the evaluation protocol, the preprocessing, the decision threshold, or the FacePlugin version used. Second, LFW is close to saturated. Many published models score above 99.5% on it, so 98.5% is respectable but doesn't separate this model from the field on its own. Third, verification accuracy on fixed pair lists doesn't predict performance on your cameras, your lighting, or your user population.
So what does an accuracy number actually buy you? Only a decision rule. It becomes meaningful once you know where you set the threshold.
Running your first comparison
Setup follows a clear sequence, though the README's Windows path differs from the Linux path:
- Install Python 3.9 or higher. The README's Windows route uses
wingetand a PowerShell script,install.ps1. - Clone the repository and create an isolated environment with
conda create -n facesdk python=3.9 -y. - Activate it and install dependencies with
pip install -r requirements.txt. - Run the example below. If you're on Linux, read
install.ps1and reproduce its steps by hand.
from face_recognition_sdk import FaceRecognition
face_sdk = FaceRecognition()
faces1 = face_sdk.GetImageInfo("test/1.jpg", faceMaxCount=1)
faces2 = face_sdk.GetImageInfo("test/2.png", faceMaxCount=1)
if faces1 and faces2:
similarity = face_sdk.get_similarity(faces1[0]["embedding"], faces2[0]["embedding"])
print(f"Similarity: {similarity}%")
Here's a gotcha the README skips. faceMaxCount=1 caps the result at one face, but the README doesn't say how that face is chosen. In a group photo, it may not be the person you meant. Crop to the target face first, or pick the largest bounding box yourself, before you trust the score.
Picking a threshold you can defend
The example uses 75 as the same-person threshold, and the README calls it an example that must be validated. Take that seriously. Teams often copy 75, test it on three colleagues, and ship.
Here's the failure mode. The score distributions for genuine pairs and impostor pairs overlap. Moving the threshold trades false accepts against false rejects. A few points of shift can take a door reader from annoying to dangerous.
Calibrate it on your own data, using these measurements:
- False accept rate (FAR) on impostor pairs drawn from your real population.
- False reject rate (FRR) on genuine pairs captured with your actual cameras and lighting.
- The threshold where FAR meets your security policy, not the threshold where the scores look "high."
- Score drift across sessions, days, and seasons, not one afternoon of testing.
NIST's Face Recognition Vendor Test (FRVT) is the closest thing to an independent reference for these trade-offs. Its results cover specific vendor systems under specific conditions, not this SDK. Use it as a method for measuring, not as a verdict on this code.
Privacy is local, but not automatically compliant
The on-premise design is a real advantage. Templates that never leave the device avoid a whole class of transfer and breach risk. But local processing doesn't make a system compliant.
- Under GDPR, biometric data processed to uniquely identify a person is a special category under Article 9. Local processing still counts.
- Illinois' Biometric Information Privacy Act (BIPA) requires written consent before collecting biometric identifiers. Its obligations attach to collection and retention, not to where your servers sit.
- Stored embeddings are personal data. Encrypt them at rest and define deletion rules before launch.
Licensing needs the same scrutiny. The repository calls itself "completely free" with "no SDK licensing fees," and it's built on FacePlugin's open-source model. The fetched README doesn't include license text. Before commercial use, read the repository's LICENSE file and FacePlugin's upstream license, and confirm that the weights you download are covered. Don't assume the README's marketing language settles it.
The liveness gap is the one that matters most
The topic description includes face liveness detection and face anti-spoofing, which is the feature that stops someone holding a printed photo or a phone screen up to your reader. Nothing in the README documents it.
Here's the counter-intuitive part. For access control, a high similarity score can be dangerous on its own. A good photo of the enrolled person will score high. Similarity answers "do these two images show the same face?" It doesn't answer "is a live person standing in front of the camera?"
Presentation attack detection (PAD) is a separate problem. The standard to measure it against is ISO/IEC 30107-3, which defines testing methods for presentation attack detection. Nothing in this README shows the SDK meets it. If you need liveness, plan for a dedicated PAD component, or a vendor evaluated against that standard, and treat this SDK as the matching layer. Most guides skip this step. Don't.
| Decision | Use this SDK for | Add something else for |
|---|---|---|
| Matching two images | Yes, with threshold calibration | No |
| Liveness at a door reader | No | PAD component tested to ISO/IEC 30107-3 |
| Storing enrolled templates | Yes, encrypted at rest | Consent and deletion workflow |
Frequently Asked Questions
What is the open source face recognition SDK from nataphong-lab?
It's a free Python SDK for Windows and Linux. It detects faces, returns bounding boxes, landmarks, and feature embeddings, and computes a similarity score between two faces. According to the repository, it's built by further training FacePlugin's open-source model, and processing runs locally.
how do you compare two faces in python?
Call GetImageInfo on each image with faceMaxCount=1, take the embedding from each result, and pass both to get_similarity(). The function returns a score from 0 to 100. Set your threshold by testing genuine and impostor pairs from your own population, not by copying the example value of 75.
why isn't a high similarity score enough for access control?
Similarity only shows that two images match. It doesn't show that a live person is present. A printed photo of an enrolled user can score high, so access control needs presentation attack detection as a separate layer, typically tested against ISO/IEC 30107-3.
does this face recognition SDK need an internet connection?
The README says processing is on-premise and that biometric data doesn't need to leave your device. It doesn't document whether model weights download at runtime. If you're deploying to an air-gapped site, check the install process and confirm that everything you need ships with the repository.
Pick your threshold this week, not after launch
The most actionable takeaway: treat open source face recognition as a matching component, not a finished security system. Clone the repository, run the comparison on 50 of your own genuine and impostor pairs, and record the false accept rate at three candidate thresholds. Pass this to anyone about to ship a face-based login on the strength of a benchmark table.