# mini-face
## Installation with `pip`
> Requirements: `python >= 3.12`, `numpy >= 1.21`.
1. Install the package with a following command:
```shell
python3 -m pip install mini-face
```
2. Download model data files (`model` and `AU_predictors`) from this repository or official
[OpenFace release](https://github.com/TadasBaltrusaitis/OpenFace/releases).
You will also need files from [OpenFace models](https://github.com/TadasBaltrusaitis/OpenFace/wiki/Model-download).
## Example
To estimate gaze on a single image, simply run:
```python
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 = }")
```
Raw data
{
"_id": null,
"home_page": null,
"name": "mini-face",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "OpenFace, vcpkg, pybind11, scikit-build, cpp",
"author": null,
"author_email": "Igor Swat <iswat@student.agh.edu.pl>, Jan Sm\u00f3\u0142ka <jp.smolka@gmail.com>",
"download_url": null,
"platform": null,
"description": "# mini-face\n\n## Installation with `pip`\n> Requirements: `python >= 3.12`, `numpy >= 1.21`.\n1. Install the package with a following command:\n```shell\n python3 -m pip install mini-face\n```\n2. Download model data files (`model` and `AU_predictors`) from this repository or official\n [OpenFace release](https://github.com/TadasBaltrusaitis/OpenFace/releases).\n You will also need files from [OpenFace models](https://github.com/TadasBaltrusaitis/OpenFace/wiki/Model-download).\n\n## Example\nTo estimate gaze on a single image, simply run:\n\n```python\nfrom pathlib import Path\n\nimport cv2\nimport numpy as np\nfrom mini_face import gaze, PredictionMode\n\n\nif __name__ == \"__main__\":\n extractor = gaze.Extractor(\n mode=PredictionMode.IMAGE, # Specify prediction mode\n focal_length=(500.0, 500.0), # Specify camera parameters\n optical_center=(860.0, 540.0), # required for proper 3D estimation\n models_directory=Path(\"./model\"), # Pass a directory to search for OpenFace weights in\n )\n\n image = cv2.imread(\"test_image.jpg\")\n result = extractor.predict(\n image, # Pass the image to analyze\n np.array([0, 0, 1080, 1920]) # along with a region to search for face in\n )\n\n print(f\"{result = }\")\n```\n",
"bugtrack_url": null,
"license": "BSD 3-Clause License",
"summary": "A minimalist Python wrapper for OpenFace library",
"version": "0.1.3",
"project_urls": {
"repository": "https://github.com/child-lab-uj/mini-face"
},
"split_keywords": [
"openface",
" vcpkg",
" pybind11",
" scikit-build",
" cpp"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "575b7e8d8c5e88641558bac88412032c8c9428dd244cff78e438dad684e222ed",
"md5": "68ebb43ee5b4f0b0c22e78995789c151",
"sha256": "570ad8e407258399d04815d79e1f01b78649b73041316cb442523e8c42b4befb"
},
"downloads": -1,
"filename": "mini_face-0.1.3-cp312-cp312-macosx_14_0_arm64.whl",
"has_sig": false,
"md5_digest": "68ebb43ee5b4f0b0c22e78995789c151",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.12",
"size": 3805414,
"upload_time": "2024-11-07T23:28:05",
"upload_time_iso_8601": "2024-11-07T23:28:05.659951Z",
"url": "https://files.pythonhosted.org/packages/57/5b/7e8d8c5e88641558bac88412032c8c9428dd244cff78e438dad684e222ed/mini_face-0.1.3-cp312-cp312-macosx_14_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c7b6b587f0d5f0fe5c5cc8ba30f27848c89af3af94a84474782e8521fbe95709",
"md5": "abda8feb7577fc3669674650fb0ff2cf",
"sha256": "5a5bce056ce8210448e6d1f1067795a39729502df184df987a75a917a5eff58b"
},
"downloads": -1,
"filename": "mini_face-0.1.3-cp312-cp312-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "abda8feb7577fc3669674650fb0ff2cf",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.12",
"size": 32322089,
"upload_time": "2024-11-07T23:28:08",
"upload_time_iso_8601": "2024-11-07T23:28:08.604268Z",
"url": "https://files.pythonhosted.org/packages/c7/b6/b587f0d5f0fe5c5cc8ba30f27848c89af3af94a84474782e8521fbe95709/mini_face-0.1.3-cp312-cp312-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ee174f56006e7d8081f72c10f9d67c6072d885d923e359ba172d11ee3905cdfb",
"md5": "ee4350fdce2ab777061111ed88c73176",
"sha256": "c25ac3239abf5584321f82ffebed8145e0c58839badb715109aea5b5fa6b7144"
},
"downloads": -1,
"filename": "mini_face-0.1.3-cp312-cp312-win_amd64.whl",
"has_sig": false,
"md5_digest": "ee4350fdce2ab777061111ed88c73176",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.12",
"size": 14622153,
"upload_time": "2024-11-07T23:28:12",
"upload_time_iso_8601": "2024-11-07T23:28:12.064627Z",
"url": "https://files.pythonhosted.org/packages/ee/17/4f56006e7d8081f72c10f9d67c6072d885d923e359ba172d11ee3905cdfb/mini_face-0.1.3-cp312-cp312-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "33dd049b40f00f997742df62450caefbcfa699a7b60d7808ba4298c6da7ce0b9",
"md5": "15ec07a32459b7dcc657de7884f7973b",
"sha256": "809acf0640af3e21ee9c5eec7c4c0485e3d89edbe7270a01e2c7e5b91749040c"
},
"downloads": -1,
"filename": "mini_face-0.1.3-cp313-cp313-macosx_14_0_arm64.whl",
"has_sig": false,
"md5_digest": "15ec07a32459b7dcc657de7884f7973b",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.12",
"size": 3805547,
"upload_time": "2024-11-07T23:28:14",
"upload_time_iso_8601": "2024-11-07T23:28:14.953846Z",
"url": "https://files.pythonhosted.org/packages/33/dd/049b40f00f997742df62450caefbcfa699a7b60d7808ba4298c6da7ce0b9/mini_face-0.1.3-cp313-cp313-macosx_14_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "47c549aaa8b3a865ab3e2a9d661acb8dbcc091f280c03b31a93c5519ed5a50b8",
"md5": "7350dc3d21d00dd5a4e632871cb7d8ef",
"sha256": "8aab786def7b3a768230b72cf433f9d965df7f22e71c4a64964a24d759b42e25"
},
"downloads": -1,
"filename": "mini_face-0.1.3-cp313-cp313-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "7350dc3d21d00dd5a4e632871cb7d8ef",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.12",
"size": 32322195,
"upload_time": "2024-11-07T23:28:18",
"upload_time_iso_8601": "2024-11-07T23:28:18.607993Z",
"url": "https://files.pythonhosted.org/packages/47/c5/49aaa8b3a865ab3e2a9d661acb8dbcc091f280c03b31a93c5519ed5a50b8/mini_face-0.1.3-cp313-cp313-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "41ea6519e9a4aa7b7246dd43e0def7b11777a1aa5e46914d843a319ba491ab78",
"md5": "713f78e8606d3588e7006e6d106ae317",
"sha256": "51855826598012d285976d65c8e5d77fcbb67ee1f06631dfadb2fba4099442ab"
},
"downloads": -1,
"filename": "mini_face-0.1.3-cp313-cp313-win_amd64.whl",
"has_sig": false,
"md5_digest": "713f78e8606d3588e7006e6d106ae317",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.12",
"size": 14622142,
"upload_time": "2024-11-07T23:28:22",
"upload_time_iso_8601": "2024-11-07T23:28:22.250082Z",
"url": "https://files.pythonhosted.org/packages/41/ea/6519e9a4aa7b7246dd43e0def7b11777a1aa5e46914d843a319ba491ab78/mini_face-0.1.3-cp313-cp313-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-07 23:28:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "child-lab-uj",
"github_project": "mini-face",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "mini-face"
}