Skip to main content

A Python module for face comparison using face_recognition and Base64 conversion.

Project description

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.

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

face_comparer-2.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

face_comparer-2.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file face_comparer-2.0.tar.gz.

File metadata

  • Download URL: face_comparer-2.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for face_comparer-2.0.tar.gz
Algorithm Hash digest
SHA256 879c3b903a384aba58d3f18597de5ce934d1922df753d24effac451f0b31e0f6
MD5 0d479de782dd475a524fba1cfce1de1e
BLAKE2b-256 fd104c1b4ce0f2ed95a235c0d66eb337a0012c28a4292ee89e380f529516bb83

See more details on using hashes here.

File details

Details for the file face_comparer-2.0-py3-none-any.whl.

File metadata

  • Download URL: face_comparer-2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for face_comparer-2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6d92fb06c74d00e023bcfc82dc6e5803f4d6b37a747ee9214889b3812a4ca72
MD5 0c891700ca931dd8d6218b7f6e67093c
BLAKE2b-256 9336f72d91f186d5eb73a490e4433ab79ef257d58f0d35f8bca8d5a3dd0c82ba

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