A versatile Python package leveraging machine learning model for efficient image comparisons.
Project description
Pixel Perfect
A versatile Python package leveraging TensorFlow's machine learning model for efficient image comparisons. Designed to seamlessly integrate with Selenium, it empowers developers with powerful tools for UI validations, making it a valuable asset for automated testing and visual verification in web applications.
Installation
You can install pixel_perfect using pip:
pip install pixel_perfect
Usage: Image Comparison
The image_similarity
method allows you to compare two images and receive a boolean value indicating whether the images are similar or not. The comparison is performed with a default threshold of 0.1, providing a balance between strictness and leniency. You can customize the threshold by adjusting the value.
from pixel_perfect import image_similarity
# Provide paths to the images for comparison
image_path1
image_path2
# Compare the images with default threshold
isImageSimilar = image_similarity(image_path1, image_path2)
# Compare the images with custom threshold
isImageSimilar = image_similarity(image_path1, image_path2, 1)
You can utilize the image_similarity_score
method to compare two images and obtain the similarity score. Here's a simple example:
from pixel_perfect import image_similarity
# Provide paths to the images for comparison
image_path1
image_path2
# Compare the images
similarity_score = image_similarity(image_path1, image_path2)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pixel_perfect-3.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b0d85fb8037b738e14492d863625374d0797603bf5490d46016c6993efd05f9 |
|
MD5 | a51cafb8f3e5d96920e423103c9c0d77 |
|
BLAKE2b-256 | 7142c4b87fb810f3e21cda7b55fb6df23e8cf74afd93378bf10f7e8eb57cd12d |