Extracts faces from an image using different backend detectors and save the results in a DataFrame.
pip install gesichtfinder
Tested against Windows 10 / Python 3.10 / Anaconda
This function utilizes the deepface library for face detection, allowing you to choose from various backend detectors
for detecting faces in an image. The detected face regions can be optionally cropped and stored in the DataFrame.
Parameters:
img (str or ndarray): The path to the input image or the image's numpy array representation (RGB format).
cut_out_faces (bool, optional): If True, the detected face regions will be cropped and stored in the DataFrame.
If False, only face coordinates and attributes will be included. Default is True.
backends (tuple, optional): A tuple containing the names of the backend detectors to use for face detection.
Available backends include 'opencv' and 'retinaface'.
Default is ('opencv', 'retinaface').
**kwargs: Additional keyword arguments to be passed to the deepface.extract_faces function.
You can specify options like min_face_size, model, enforce_detection, and more.
Returns:
pandas.DataFrame: A DataFrame containing details of the detected faces and their attributes, including:
- 'x': X-coordinate of the top-left corner of the detected face bounding box.
- 'y': Y-coordinate of the top-left corner of the detected face bounding box.
- 'w': Width of the detected face bounding box.
- 'h': Height of the detected face bounding box.
- 'end_x': X-coordinate of the bottom-right corner of the detected face bounding box.
- 'end_y': Y-coordinate of the bottom-right corner of the detected face bounding box.
- 'confidence': Confidence score of the face detection.
- 'backend': The backend detector used for the detection.
- 'faces' (optional): Cropped face regions if 'cut_out_faces' is True.
Example:
# Import the required libraries
# Example usage:
from gesichtfinder import get_faces
df = get_faces(img=r"c:\asy.jpg", cut_out_faces=True, backends=('opencv', 'retinaface'))
print(df)
Metadata
Release files for gesichtfinder 0.10
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 |
|---|---|---|---|---|
| gesichtfinder-0.10.tar.gz | 5.0 kB | Without provenance | Details for gesichtfinder-0.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gesichtfinder-0.10-py3-none-any.whl | Python 3 | none | any | Details for gesichtfinder-0.10-py3-none-any.whl |
Total release size: 12.5 kB
Release files / gesichtfinder-0.10.tar.gz
| Download URL | gesichtfinder-0.10.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
483a450edb7d50863e0b56b456ec1659ea4dd49a7c2922a77e3b901617f38cd5
|
|
BLAKE2b-256 checksum How to use checksums |
a40490ac108fb090e539fcba33e00c565e38b517bfef0ad631bb2d2d83905014
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Release files / gesichtfinder-0.10-py3-none-any.whl
| Download URL | gesichtfinder-0.10-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4c202e92d22a1a8f0cba7f67f48720217e9c30d58b187f00c3617d4b2a15185d
|
|
BLAKE2b-256 checksum How to use checksums |
d89ac36dfba1a96325e2aef01e27c79cdde97731aabfdeaeaeb5827f071de012
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Security for gesichtfinder 0.10
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.