Metadata-Version: 2.4
Name: pyface-docsaid
Version: 0.4.0
Summary: An Integrated Python Package for Face Analysis.
Author-email: kunkunlin <jacklin@cmlab.csie.ntu.edu.tw>
License: Apache License 2.0
Project-URL: Homepage, https://github.com/DocsaidLab/PyFace
Project-URL: Repository, https://github.com/DocsaidLab/PyFace
Project-URL: Issues, https://github.com/DocsaidLab/PyFace/issues
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=2
Requires-Dist: scikit-image
Requires-Dist: capybara-docsaid>=0.12.0
Requires-Dist: huggingface_hub
Dynamic: license-file

# PyFace

[![license](https://img.shields.io/badge/license-Apache%202-dfd.svg)](./LICENSE)
[![python](https://img.shields.io/badge/python-3.10+-aff.svg)](./pyproject.toml)
[![release](https://img.shields.io/github/v/release/DocsaidLab/PyFace?color=ffa)](https://github.com/DocsaidLab/PyFace/releases)
[![pypi](https://img.shields.io/pypi/v/pyface-docsaid.svg)](https://pypi.org/project/pyface-docsaid/)
[![downloads](https://img.shields.io/pypi/dm/pyface-docsaid?color=9cf)](https://pypi.org/project/pyface-docsaid/)

## Introduction

PyFace is a Python library for face detection, face landmark, face depth, face recognition, etc.

![PyFace Overview](https://media.githubusercontent.com/media/DocsaidLab/PyFace/refs/heads/main/docs/teaser.jpg)

## Installation

### Requirements

- Python 3.10+

### Install via pypi

```bash
pip install -U pip wheel
pip install setuptools # for python 3.12
pip install pyface-docsaid
```

### Install via GitHub

```bash
pip install -U pip wheel
pip install setuptools # for python 3.12
pip install git+https://github.com/DocsaidLab/PyFace.git
```

## Usage

You can see [demo](demo) for more details.

### General usage

We recommend to use `FaceService` for integrating all face models.

```python
import capybara as cb
import pyface as pf

face_service = pf.FaceService(
    batch_size=1,
    enable_recognition=True,
    enable_depth=True,
    enable_landmark=True,
    face_bank='path/to/face_bank',
    recog_level='High',
    detect_kwargs={"gpu_id": 0, "backend": "cuda"}, # if you want to use GPU on detection
    landmark_kwargs={"backend": "cpu"}, # if you want to use CPU on landmark
    ...
)
img = cb.imread('path/to/image')
faces_on_img = face_service([img])[0]
# Plotted faces on image
cb.imwrite('path/to/output', faces_on_img.gen_info_img())
```

## Citation

```bibtex
@misc{lin2025pyface,
  author       = {Kun-Hsiang Lin},
  title        = {PyFace: An Integrated Python Package for Face Analysis},
  year         = {2025},
  publisher    = {GitHub},
  howpublished = {\url{https://github.com/DocsaidLab/PyFace}}
}
```
