Compares two images using siamese networks
Project description
py-image-comparer
Compares two images using Siamese Network trained from a Pytorch Implementation
Installation
To install, run
pip install image-comparer
Usage
CLI
image-compare
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
Programmatically
With PIL
import image_comparer
from PIL import Image
image = Image.open("test/kobe.jpg")
image2 = Image.open("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)
Development
Installation
pip install -r requirements-test.txt
Tests
To run tests, run
pytest
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
image-comparer-1.0.0.tar.gz
(7.7 kB
view hashes)
Built Distribution
Close
Hashes for image_comparer-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2acdc79e33b472be1501ff7115f37a3effacc663edec720e39fe8c5dc58dcddc |
|
MD5 | cf130b8e556f64386f942af028022ef6 |
|
BLAKE2b-256 | e25f8982f4ff0f1328fd2a3f7808e14bda38d482b04c111a54de89f8a5ad2947 |