Skip to content

DocsaidLab/PyFace

Repository files navigation

PyFace

license python release pypi downloads

Introduction

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

PyFace Overview

Installation

Requirements

  • Python 3.10+

Install via pypi

pip install pyface-docsaid

Install via GitHub

pip install git+https://github.com/DocsaidLab/PyFace.git

For Python 3.12

Because onnxsim is not prebuilt in Python 3.12. We recommend prebuild it manually.

pip install wheel setuptools
pip install onnxsim
pip install pyface-docsaid

Usage

You can see demo for more details.

General usage

We recommend to use FaceService for integrating all face models.

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

@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}}
}

About

An Integrated Python Package for Face Analysis

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •