Skip to main content

Face Comparer

Overview

This Python module provides functionality to encode images to Base64 format and compare faces. It supports both file-based and Base64-based image comparisons.

Table of Contents

Installation

Ensure you have the required dependencies installed before using this module:

pip install face_recognition numpy pillow

Usage

Importing the Module

from face_comparer import ImageConverter, FaceComparer

Convert Image to Base64

converter = ImageConverter()
base64_string = converter.image_to_base64("path_to_image.jpg")

Convert Base64 to Image

image_array = converter.base64_to_image(base64_string)

Compare Faces from Image Paths

comparer = FaceComparer()
result = comparer.compare_faces("image1.jpg", "image2.jpg")
print(result)

Compare Faces from Base64 Strings

result = comparer.compare_faces_from_base64(base64_string1, base64_string2)
print(result)

Features

  • Convert images to Base64 format and vice versa.
  • Compare faces using face_recognition.
  • Handle both file paths and Base64 encoded images.

Limitations

  • Requires images to have at least one recognizable face.
  • Works best with clear, front-facing images.

License

This project is licensed under the MIT License.

Metadata

Release files for face-comparer 2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for face-comparer 2.0
File Size Uploaded Provenance
face_comparer-2.0.tar.gz 3.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for face-comparer 2.0
File Interpreter ABI Platform
face_comparer-2.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.9 kB

Release files / face_comparer-2.0.tar.gz

Download URL face_comparer-2.0.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
879c3b903a384aba58d3f18597de5ce934d1922df753d24effac451f0b31e0f6
BLAKE2b-256 checksum
How to use checksums
fd104c1b4ce0f2ed95a235c0d66eb337a0012c28a4292ee89e380f529516bb83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / face_comparer-2.0-py3-none-any.whl

Download URL face_comparer-2.0-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6d92fb06c74d00e023bcfc82dc6e5803f4d6b37a747ee9214889b3812a4ca72
BLAKE2b-256 checksum
How to use checksums
9336f72d91f186d5eb73a490e4433ab79ef257d58f0d35f8bca8d5a3dd0c82ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Security for face-comparer 2.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page