A minimalist Python wrapper for OpenFace library
Project description
Mini-face
Installation with pip
Requirements:
python 3.12
,numpy >= 1.21
.
- Install the package with a following command:
python3 -m pip install mini-face
- Download model data files (subdirectories /model/ and /AU_predictors/) from this repository or official OpenFace release. You will also need files from here.
Python usage
Below is a minimalist example of using the module from Python code:
import cv2
import numpy as np
from mini_face import GazeFeatureExtractor
from mini_face import PredictionMode
if __name__ == "__main__":
image = cv2.imread("test_image.jpg")
extractor = GazeFeatureExtractor(
mode=PredictionMode.IMAGE,
focal_length=(500, 500),
optical_center=(860.0, 540.0),
models_directory="./model",
)
result = extractor.predict(image, np.array([0.0, 0.0, 1080.0, 1920.0]))
print(f"{result = }")
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
mini_face-0.1.0.tar.gz
(14.5 MB
view hashes)
Built Distribution
Close
Hashes for mini_face-0.1.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98087280df7e65b015b4379b3aeab01edc59ac8a8b74c9a8157528e68e2d1a34 |
|
MD5 | 5bcb1556fc036a5c4352d7de834fa10e |
|
BLAKE2b-256 | 82db92a88c767e40662bb923ce76db1dbc26ef771917c1922397aca110a0e097 |