Identity Verification with Facial Recognition
Project description
OpenFaceID - Identity Verification with Facial Recognition
OpenFaceID is an open-source identity verification project that utilizes facial recognition technology to provide a robust and secure solution for detecting and authenticating known faces. This project aims to deliver a seamless and reliable user experience for identity verification in various applications.
Installation
Use the following command to install OpenFaceID:
pip install openfaceid
Getting Started
To get started with OpenFaceID, you can follow the FAISS example below:
import faiss
from openfaceid import face_detector
from openfaceid.vector_stores.faiss import FAISS
# Threshold distance used to determine if a face is considered a match or not.
# In this example, it's set to 0.25, which is specific to FAISS and the test images used during testing.
# You may need to adjust this threshold based on your dataset and vector store.
# A lower value means stricter matching, while a higher value allows for more leniency in matching.
_DISTANCE_THRESHOLD = 0.25
fd = face_detector.FaceDetector()
# Get all image ids and vector embeddings of existing faces, i.e. loading from a database
all_embeddings = []
# Initialize the FAISS index and add all image embeddings to it
dimension = len(all_embeddings[0][1])
index = faiss.IndexFlatL2(dimension)
faiss_store = FAISS(index)
faiss_store.add_embeddings(all_embeddings)
# Load the image and perform identity verification
# Replace "path-to/new_selfie.jpg" with the actual path to your new selfie image
face_embedding = fd.get_embeddings(image_path="path-to/new_selfie.jpg")
scores, image_ids = faiss_store.search_with_score(face_embedding)
found = scores[0] < _DISTANCE_THRESHOLD
if found:
print(f"The face has been successfully matched to an existing face with the id of {image_ids[0]}.")
else:
print("Unknown selfie.")
This code can run when initialising the server. For more examples check ./examples
folder.
Contributing
We welcome contributions to OpenFaceID! If you have ideas, bug reports, or feature requests, please feel free to open an issue or submit a pull request. For more information, see CONTRIBUTING.md.
License
OpenFaceID is released under the Apache License 2.0. Please review the license for more details.
Acknowledgements
We would like to express our gratitude to the open-source community and the developers of the underlying facial recognition technology that makes OpenFaceID possible.
Contact
For questions or inquiries, please contact at ahalimkara@gmail.com
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
File details
Details for the file openfaceid-0.1.0.tar.gz
.
File metadata
- Download URL: openfaceid-0.1.0.tar.gz
- Upload date:
- Size: 27.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.3 Darwin/22.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5cb09fba619fa5862a343ed12da802c72727e0d91dad003f04d66b3d843f224 |
|
MD5 | 88c89b9f422b5ea0edb5a0f5fd6df1d0 |
|
BLAKE2b-256 | 189b1381ee5fa6497ec5da527a8db293abe4ab6163990ba26cab99850effb9cb |
File details
Details for the file openfaceid-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: openfaceid-0.1.0-py3-none-any.whl
- Upload date:
- Size: 27.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.3 Darwin/22.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 784a3c8ad83e53bb6d35a8237f661484788577c62ec135a885bc203ce464e10d |
|
MD5 | 11d442a81f36f332496b9a247dfb72ac |
|
BLAKE2b-256 | 169acc91bff8d82477489410e6ff37b4fdfd38e7032ea54cdd053519ea3bb633 |