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 (
modelandAU_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
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 Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mini_face-0.1.2-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: mini_face-0.1.2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e50c6b4c3fe70db4d9d1b6d8296ce753c11751014e5b7e2d160f26510bc3269d
|
|
| MD5 |
e3946e42855c9d53086ad2156d53469e
|
|
| BLAKE2b-256 |
4ae65f520717a7a23a5bc75289c2481fc6f41bb1e85f9b33c35face01d9dc04c
|
File details
Details for the file mini_face-0.1.2-cp313-cp313-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: mini_face-0.1.2-cp313-cp313-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 32.3 MB
- Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eac1316563c72f1140db98d8682b918152b0cd7137f5c4f04b06725ca25a4f74
|
|
| MD5 |
5990b290c6f785d18520dbff9e1bc0dc
|
|
| BLAKE2b-256 |
3c709a14b66f5c6e4c0ba2ce910c3f65281a2d1649d2cf029ac66824cebfbf19
|
File details
Details for the file mini_face-0.1.2-cp313-cp313-macosx_14_0_arm64.whl.
File metadata
- Download URL: mini_face-0.1.2-cp313-cp313-macosx_14_0_arm64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.13, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd2643e0e99ec4aaf1c682a91dc16b49a209b63c8ce5c41163f12b2b31542697
|
|
| MD5 |
1af06e753d6473763b9c6d28b16d0bef
|
|
| BLAKE2b-256 |
e2ecc1fade9f8a25fcf6e1de13cc83b7dd3e73be6e773516a0f27e63110291f8
|
File details
Details for the file mini_face-0.1.2-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: mini_face-0.1.2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96f01d03d7e177577d93ef48163b1a4e288f1fdc7fa34083fa3476a77357b765
|
|
| MD5 |
fb14627da64387d969deb0e83d032748
|
|
| BLAKE2b-256 |
7a4777f4925d8e393bcf9c8c09a5c01d8bbd3857d04200c491baf41aa67ea476
|
File details
Details for the file mini_face-0.1.2-cp312-cp312-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: mini_face-0.1.2-cp312-cp312-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 32.3 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d891e190d9d9c64882326b16864307305763c0ce7b9baa898e5d8e8734650a9
|
|
| MD5 |
aa0b079c9f41303281cb5bf506f468a0
|
|
| BLAKE2b-256 |
fbc29e2bc872b929711307522d18814c61fee260a32346454391262b59da84bb
|
File details
Details for the file mini_face-0.1.2-cp312-cp312-macosx_14_0_arm64.whl.
File metadata
- Download URL: mini_face-0.1.2-cp312-cp312-macosx_14_0_arm64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.12, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a11f8774be72caf8bbcf044f89099688726e64e63c52c255fb5c06d25fab252
|
|
| MD5 |
43715a29ff578d89ee0a9da637a6c0ef
|
|
| BLAKE2b-256 |
8f6847bd38b1f4319941ce0f3e7138dc5cddbb0810aba1ead380aea3f552fc8a
|