PyLipExtractor
PyLipExtractor is a powerful and easy-to-use Python package for extracting lip regions from videos. It leverages the high-precision MediaPipe Face Mesh to accurately detect and crop the lip area, providing a stable and reliable tool for researchers and developers working on lip-reading, facial analysis, and other related fields.
For detailed information about the package, its features, and how to use them, please refer to the Full Documentation.
Key Features
- Accurate & Stable Lip Detection: Utilizes MediaPipe Face Mesh for precise landmark detection.
- Temporal Smoothing: Applies an Exponential Moving Average (EMA) filter for smooth and consistent lip crops.
- Illumination Normalization: Includes an optional histogram matching filter to normalize video brightness.
- Flexible Configuration: Offers a wide range of customizable settings.
- Customizable Hardware Acceleration: Choose your preferred processing device (
auto,cuda, orcpu) for video conversion. The package leverages NVIDIA GPU acceleration (if available) for faster processing and uses lossless compression to ensure no quality is lost.
Demo
https://github.com/user-attachments/assets/a6841309-3e4d-4b7e-bd0f-b56a5cab28e4
Original video by Tima Miroshnichenko
Installation
pip install pylipextractor
Quick Start
Here is a basic example of how to use PyLipExtractor. For a more detailed and comprehensive example, please see examples/example_usage.py.
from pylipextractor.lip_extractor import LipExtractor
# Create a LipExtractor instance
extractor = LipExtractor()
# Specify the path to your video
video_path = "path/to/your/video.mp4"
output_path = "output/lip_frames.npy"
# Extract the lip frames
extracted_frames, rtf_value = extractor.extract_lip_frames(video_path, output_path)
if extracted_frames is not None:
print(f"Successfully extracted {len(extracted_frames)} frames.")
if rtf_value is not None:
print(f"Real-Time Factor (RTF): {rtf_value:.4f}")
Documentation
For a deep dive into all the features, configurations, and technical details, please read our Comprehensive Documentation.
Contributing
Contributions are welcome! Please see our Contributing Guidelines for more details.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Metadata
Release files for pylipextractor 2.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pylipextractor-2.2.4.tar.gz | 15.8 kB | Without provenance | Details for pylipextractor-2.2.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pylipextractor-2.2.4-py3-none-any.whl | Python 3 | none | any | Details for pylipextractor-2.2.4-py3-none-any.whl |
Total release size: 30.8 kB
Release files / pylipextractor-2.2.4.tar.gz
| Download URL | pylipextractor-2.2.4.tar.gz |
|---|---|
| Size | 15.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea87d9e12aa4566788647f8c3414754dd0094e444fc9aa0485ce501e3fb87515
|
|
BLAKE2b-256 checksum How to use checksums |
680201c835318d8c08a74ff02c79382f633f387ed106eab2be252b99329cd0ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|
Release files / pylipextractor-2.2.4-py3-none-any.whl
| Download URL | pylipextractor-2.2.4-py3-none-any.whl |
|---|---|
| Size | 15.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4699356d6ce73f671e4bbe31db64bbb6a03e8c0d553113fc574c1e540b9cceba
|
|
BLAKE2b-256 checksum How to use checksums |
a8b849fadc29f79753944e055817515ab5e4b056282e1c2134bf5a263a54e3d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|
Security for pylipextractor 2.2.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.