keras-facenet
This is a simple wrapper around this wonderful implementation of FaceNet. I wanted something that could be used in other applications, that could use any of the four trained models provided in the linked repository, and that took care of all the setup required to get weights and load them. I prefer using Keras wherever possible because of its API, so I used the example provided here and implemented it as part of the code.
Enough background -- so how are you supposed to use this?
Installing
pip install keras-facenet
Usage
To get embeddings for the faces in an image, you can do something like the following.
from keras_facenet import FaceNet
embedder = FaceNet()
# Gets a detection dict for each face
# in an image. Each one has the bounding box and
# face landmarks (from mtcnn.MTCNN) along with
# the embedding from FaceNet.
detections = embedder.extract(image, threshold=0.95)
# If you have pre-cropped images, you can skip the
# detection step.
embeddings = embedder.embeddings(images)
Logging
To see what's going on under the hood, set logging to view INFO logs. If using in a Jupyter notebook, you can use the following.
import logging
logging.basicConfig()
log = logging.getLogger()
log.setLevel('INFO')
Metadata
Release files for keras-facenet 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| keras-facenet-0.3.2.tar.gz | 10.3 kB | Without provenance | Details for keras-facenet-0.3.2.tar.gz |
Release files / keras-facenet-0.3.2.tar.gz
| Download URL | keras-facenet-0.3.2.tar.gz |
|---|---|
| Size | 10.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5df16907c293289ba3198455d97cc6960dc209887c2d6ce3aa9a51a8d62c2a32
|
|
BLAKE2b-256 checksum How to use checksums |
6ac56fadf919a86c44b87ba9d8134cc83820b8fa8a98f5c68ff676179e052839
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.3 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.2
|
Security for keras-facenet 0.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.