Skip to main content

PyFAME: the Python Facial Analysis and Manipulation Environment

Project description

Tests Docs

PyFAME: the Python Facial Analysis and Manipulation Environment

PyFAME is a python package for dynamic region occlusion and skin colour modification of faces in video and images. Provides a range of tools for changing the colour of user-specified facial regions using industry-standard colour spaces (Lab, HSV, BGR), occlusion of user-defined facial regions (e.g., eyes, nose, mouth, hemi-face), and isolation of the head from background scene through video matting. Facial modifications can be further transitioned on and off through a range of timing functions (e.g., linear, sigmoid, Gaussian etc).

PyFAME enables researchers to apply complex facial manipulations to just the face in dynamic video and still images scenes in several lines of code. Here is an example of PyFAME performing pixel-level modifications to create new videos from the original one:

Statement of Need

Currently, there are no available tools for performing these types of pixel-level operations over videos. Existing research has commonly used general image editing tools (such as Photoshop). However, these tools apply changes to the entire image, causing noticeable background artifacts. PyFAME provides users the ability to selectively modify specific regions of the face, for both static images and videos. Our package also seamlessly integrates temporal functions into it's video processing, allowing users to specify how and when pixel-level operations will be applied.

A Quick Example:

import pyfame as pf

# pyfame.core functions are all exposed in the top-level import
pf.occlude_face_region(...)

# Extra utility functions like the parameter display functions are 
# available in pyfame.utils
pf.utils.display_all_landmark_paths()

# Specific commonly used utils submodules are exposed at the top level 
# This includes all predefined constants, landmarks and timing functions
pf.OCCLUSION_FILL_BAR
pf.HEMI_FACE_LEFT_PATH
pf.sigmoid()

Underlying Model

MediaPipe's Face Mesh solution provides automated detection of 478 unique facial landmarks. By accessing the x-y pixel coordinates of these landmarks, many complex image and video manipulations can be performed. For more on mediapipe, see here

Documentation and Changelog

This project maintains a changelog, following the format of keep a changelog. This project also adheres to semantic versioning.

To view our documentation, examples and tutorials, see PyFAME Docs.

Contributing

PyFAME is a young project, and it is still far from perfect! If you have any ideas on how to improve the package please submit an inquiry and we will work on implementing it right away!

Pull requests are always welcome. If you spot a mistake, error, or inefficiency within the source code, let us know!

License

GPLv3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyfame-1.0.2.tar.gz (6.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyfame-1.0.2-py3-none-any.whl (6.4 MB view details)

Uploaded Python 3

File details

Details for the file pyfame-1.0.2.tar.gz.

File metadata

  • Download URL: pyfame-1.0.2.tar.gz
  • Upload date:
  • Size: 6.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for pyfame-1.0.2.tar.gz
Algorithm Hash digest
SHA256 67a4d2000a28985c4fab81389b0667bf111887084a79b779baa56b18a5c757f6
MD5 2a705ba0d47cf4e28939021fe765109a
BLAKE2b-256 a73ce26c8e6967b6dbb4141f2e50f9dc40760ce549cb1f8ea9d14f686193c1b3

See more details on using hashes here.

File details

Details for the file pyfame-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: pyfame-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for pyfame-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b43b56ed4aec9ae2d316fc80261acab7911b5345830e4b68f1050d73bb9ce32b
MD5 05880ad7e1604606881c4c72b5bcb480
BLAKE2b-256 35719560e0101ddf1552df43d730396948f1ee94db191145c681d11890d09cc6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page