Metadata-Version: 2.1
Name: mini-face
Version: 0.1.1
Summary: A minimalist Python wrapper for OpenFace library
Author-email: Igor Swat <iswat@student.agh.edu.pl>, Jan Smółka <jp.smolka@gmail.com>
License: BSD 3-Clause License
Project-URL: repository, https://github.com/child-lab-uj/mini-face
Keywords: OpenFace,vcpkg,pybind11,scikit-build,cpp
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.21

# 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
```
2. Download model data files (subdirectories **/model/** and **/AU_predictors/**) from this repository or official
   <a href="https://github.com/TadasBaltrusaitis/OpenFace/releases" title="OpenFace releases">OpenFace release</a>.
   You will also need files from <a href="https://github.com/TadasBaltrusaitis/OpenFace/wiki/Model-download" title="OpenFace models">here</a>.

## 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 = }")
```
