Skip to main content

face matching

Project description

facialmatch

facialmatch is a Python package that provides easy-to-use functions for comparing faces in images and extracting facial regions from a given image.

Features

  • 🧑‍🤝‍🧑 Compare Faces: Compare two images and check if they match with a given similarity threshold.

  • 🖼️ Extract Face: Extract and return the facial region from an image.

Installation

You can install the package via pip:

pip install facialmatch

Usage

match.py

from facialmatch import compare_faces



# Compare two faces

result = compare_faces("path/to/image1.jpg", "path/to/image2.jpg")



# Custom similarity threshold

custom_result = compare_faces("path/to/image1.jpg", "path/to/image2.jpg", minimum_similarity=0.80)

output

{

  "similarity": 0.86,

  "match": "true"

}

ExtractFace.py

from facialmatch import get_face_from_image

import matplotlib.pyplot as plt



# Extract a face from an image

face_image = get_face_from_image("path/to/image")



# Display the extracted face using matplotlib

plt.imshow(face_image)

plt.axis('off')  # Turn off the axis

plt.show()

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

facialmatch-1.0.1.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

facialmatch-1.0.1-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

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