Skip to main content

Face Recognition Engine

Project description

FaceEngine is a lightweight python library that provides an easy interface to work with face recognition tasks.

>>> from face_engine import FaceEngine
>>> engine = FaceEngine()
>>> engine.fit(['bubbles1.jpg', 'drive.jpg'], [1, 2])
>>> engine.make_prediction('bubbles2.jpg')
([(270, 75, 406, 211)], [1])

Installation

It is distributed on PyPi, and can be installed with pip:

$ pip install face-engine[insightface]

FaceEngine is supported only on Python 3.11 and above.

Models

FaceEngine is built on top of three model interfaces Detector, Embedder and Estimator (see models), and leans on user provided implementations of these models.

The default backend is insightface (the [insightface] extra), with these bundled model implementations:

name

role

model pack

notes

scrfd

detector

buffalo_l

default; deprecated alias retina_face

arcface

embedder

buffalo_l

default, 512-d

scrfd_antelopev2

detector

antelopev2

opt-in

arcface_antelopev2

embedder

antelopev2

strongest insightface embedder, 512-d

Legacy dlib python api models (hog, mmod detectors and resnet embedder with dlib pre-trained model files) are kept as an optional fallback backend used when insightface is not installed.

To work with your own custom models you have to implement required models and import it. FaceEngine models are used to register all inheriting imported subclasses (subclass registration PEP 487).

Model weights licensing

The library code is Apache-2.0, but the downloaded pre-trained model weights come with their own terms:

  • insightface model packs (buffalo_l, antelopev2) are available for non-commercial research purposes only (see insightface).

  • dlib model files have their own terms, see dlib-models.

Breaking changes in 3.0

  • Python >= 3.11 is required.

  • Pickle persistence was removed for security reasons: engines are saved as JSON (engine.save('engine.json')) and estimator state as .npz + .json files. Engines saved with face-engine < 3.0 cannot be loaded — re-fit and save again.

  • With insightface installed the default models are scrfd/arcface (previously dlib hog/resnet).

  • The retina_face detector was renamed to scrfd (the actual model architecture); the old name is kept as a deprecated alias.

  • Model downloads are verified against pinned SHA-256 checksums.

For more information read the full documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

face_engine-3.0.0.tar.gz (26.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

face_engine-3.0.0-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

Details for the file face_engine-3.0.0.tar.gz.

File metadata

  • Download URL: face_engine-3.0.0.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for face_engine-3.0.0.tar.gz
Algorithm Hash digest
SHA256 7d393d84cdfdb78825e3d0275fadabf556a0d214781811944d57e459fcc5e3f4
MD5 222729022952423149b715ddc3dcf834
BLAKE2b-256 255c84cd337099e9787d16b5ac761d08dda2e2c64a9d3945dedb0c236cf8a1ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for face_engine-3.0.0.tar.gz:

Publisher: release.yml on guesswh0/face_engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file face_engine-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: face_engine-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 23.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for face_engine-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cadec0df7de9a9a2b5b6c77390f2bea503a9bc7d08de8332c1d05b6f07bc3719
MD5 c926892061ba6f1eecadc8260c96b387
BLAKE2b-256 640b0f4181259260bf76e91307e3a495d9a9879cf800fec54aed9c27944b0c21

See more details on using hashes here.

Provenance

The following attestation bundles were made for face_engine-3.0.0-py3-none-any.whl:

Publisher: release.yml on guesswh0/face_engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page