Skip to main content

Compares two images using siamese networks

Project description

Compares two images using Siamese Network trained from a Pytorch Implementation


To install, run

pip install image-comparer




which wil show the follow help screen

usage: image-compare [-h] [--threshold THRESHOLD] Image1-Path Image2-Path

For example, you can compare two images with

image-compare tests/images/kobe.jpg tests/images/kobe2.jpg

which gives the result

kobe.jpg and kobe2.jpg are not similar


With PIL

import image_comparer
from PIL import Image

image ="test/kobe.jpg")
image2 ="test/kobe2.jpg")
image_comparer.is_similar(image, image2, threshold=0.5)

or with OpenCV

import image_comparer
import cv2

image = cv2.imread("test/kobe.jpg")
image2 = cv2.imread("test/kobe2.jpg")
image_comparer.is_similar(image, image2, threshold=0.5)



pip install -r requirements-test.txt


To run tests, run


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for image-comparer, version 1.1.2
Filename, size File type Python version Upload date Hashes
Filename, size image_comparer-1.1.2-py3-none-any.whl (6.4 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page