Skip to main content

A minimalist Python wrapper for OpenFace library

Project description

mini-face

Installation with pip

Requirements: python >= 3.12, numpy >= 1.21.

  1. Install the package with a following command:
   python3 -m pip install mini-face
  1. Download model data files (model and AU_predictors) from this repository or official OpenFace release. You will also need files from OpenFace models.

Example

To estimate gaze on a single image, simply run:

from pathlib import Path

import cv2
import numpy as np
from mini_face import gaze, PredictionMode


if __name__ == "__main__":
    extractor = gaze.Extractor(
        mode=PredictionMode.IMAGE,         # Specify prediction mode
        focal_length=(500.0, 500.0),       # Specify camera parameters
        optical_center=(860.0, 540.0),     # required for proper 3D estimation
        models_directory=Path("./model"),  # Pass a directory to search for OpenFace weights in
    )

    image = cv2.imread("test_image.jpg")
    result = extractor.predict(
        image,                             # Pass the image to analyze
        np.array([0, 0, 1080, 1920])       # along with a region to search for face in
    )

    print(f"{result = }")

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

mini_face-0.1.3-cp313-cp313-win_amd64.whl (14.6 MB view details)

Uploaded CPython 3.13Windows x86-64

mini_face-0.1.3-cp313-cp313-manylinux_2_28_x86_64.whl (32.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

mini_face-0.1.3-cp313-cp313-macosx_14_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

mini_face-0.1.3-cp312-cp312-win_amd64.whl (14.6 MB view details)

Uploaded CPython 3.12Windows x86-64

mini_face-0.1.3-cp312-cp312-manylinux_2_28_x86_64.whl (32.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

mini_face-0.1.3-cp312-cp312-macosx_14_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

File details

Details for the file mini_face-0.1.3-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: mini_face-0.1.3-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 14.6 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for mini_face-0.1.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 51855826598012d285976d65c8e5d77fcbb67ee1f06631dfadb2fba4099442ab
MD5 713f78e8606d3588e7006e6d106ae317
BLAKE2b-256 41ea6519e9a4aa7b7246dd43e0def7b11777a1aa5e46914d843a319ba491ab78

See more details on using hashes here.

File details

Details for the file mini_face-0.1.3-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mini_face-0.1.3-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8aab786def7b3a768230b72cf433f9d965df7f22e71c4a64964a24d759b42e25
MD5 7350dc3d21d00dd5a4e632871cb7d8ef
BLAKE2b-256 47c549aaa8b3a865ab3e2a9d661acb8dbcc091f280c03b31a93c5519ed5a50b8

See more details on using hashes here.

File details

Details for the file mini_face-0.1.3-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mini_face-0.1.3-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 809acf0640af3e21ee9c5eec7c4c0485e3d89edbe7270a01e2c7e5b91749040c
MD5 15ec07a32459b7dcc657de7884f7973b
BLAKE2b-256 33dd049b40f00f997742df62450caefbcfa699a7b60d7808ba4298c6da7ce0b9

See more details on using hashes here.

File details

Details for the file mini_face-0.1.3-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: mini_face-0.1.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 14.6 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for mini_face-0.1.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c25ac3239abf5584321f82ffebed8145e0c58839badb715109aea5b5fa6b7144
MD5 ee4350fdce2ab777061111ed88c73176
BLAKE2b-256 ee174f56006e7d8081f72c10f9d67c6072d885d923e359ba172d11ee3905cdfb

See more details on using hashes here.

File details

Details for the file mini_face-0.1.3-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mini_face-0.1.3-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5a5bce056ce8210448e6d1f1067795a39729502df184df987a75a917a5eff58b
MD5 abda8feb7577fc3669674650fb0ff2cf
BLAKE2b-256 c7b6b587f0d5f0fe5c5cc8ba30f27848c89af3af94a84474782e8521fbe95709

See more details on using hashes here.

File details

Details for the file mini_face-0.1.3-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mini_face-0.1.3-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 570ad8e407258399d04815d79e1f01b78649b73041316cb442523e8c42b4befb
MD5 68ebb43ee5b4f0b0c22e78995789c151
BLAKE2b-256 575b7e8d8c5e88641558bac88412032c8c9428dd244cff78e438dad684e222ed

See more details on using hashes here.

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