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.3.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.3-py3-none-any.whl (6.4 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyfame-1.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 1a0131cdd07d96d87020e84d1960aa7bc090d252457e6cf7b3cd7a68f3bd885e
MD5 3fdb97542ed5a10f92bce8192c79a4ed
BLAKE2b-256 74e3b621132a05e86b6733ad4b13bb2ca535d61c26189f8218cb0b55fcfb9de8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfame-1.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8b01c2c6964ec87f8a14dfa15ccb9d37a3e698e37e147cc880ec60f978cdf836
MD5 6e3daba62e5d7c12c4793c5079d280b2
BLAKE2b-256 12821c441028d9d31a4902a1dba090719526c7a43cb6023c6f318b0db99f11fb

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