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.4.tar.gz
.
File metadata
- Download URL: openfaceid-0.1.4.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 | 8ea2bfe983a8da9853c103f5b58b9bf433413ac5d0d8d73baa3a6604882d4f28 |
|
MD5 | 31a56e3927a8961c7769be811e733b14 |
|
BLAKE2b-256 | 2b9cf5a3d5121506c1e0e063ae04445a5079945fa7447901f9bcdceee7af23fe |
File details
Details for the file openfaceid-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: openfaceid-0.1.4-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 | 83e0818ada102a0711b7f9dc0f359d7d3e2d26ad6b8a64e8fb542614a7e6c1f4 |
|
MD5 | ad73f299e02ee3a3de570d87e45b670d |
|
BLAKE2b-256 | e7d45422ade81d453621505354d9db94364f3a5471afe2443be253694aed5755 |