Antidupe
Image deduplicator using CNN, Cosine Similarity, Image Hashing, Structural Similarity Index Measurement, and Euclidean Distance
Installation
You can install Antidupe using pip:
pip install antidupe
Usage
Basic Usage
from antidupe import Antidupe
from PIL import Image
# Initialize Antidupe
antidupe = Antidupe()
# Load images (as numpy arrays or PIL.Image objects)
image1 = Image.open("image1.jpg")
image2 = Image.open("image2.jpg")
# Check for duplicates
is_duplicate = antidupe.predict([image1, image2])
if is_duplicate:
print("Duplicate images detected!")
else:
print("Images are not duplicates.")
Customizing Thresholds
You can customize the similarity thresholds for each technique during runtime or initialization:
- Note that negative values will disable the measurement layer.
# Initialize Antidupe with custom thresholds
custom_thresholds = {
'ih': 0.2, # Image Hash
'ssim': 0.2, # SSIM
'cs': 0.2, # Cosine Similarity
'cnn': 0.2, # CNN
'dedup': 0.1 # Mobilenet
}
antidupe = Antidupe(limits=custom_thresholds)
# Check for duplicates
is_duplicate = antidupe.predict([image1, image2])
Debugging
You can enable debug mode to print debugging messages:
# Initialize Antidupe with debug mode enabled
antidupe = Antidupe(debug=True)
# Check for duplicates
is_duplicate = antidupe.predict([image1, image2])
Changing Limits During Runtime
You can change the similarity thresholds during runtime:
# Set new limits during runtime
new_thresholds = {
'ih': 0.1,
'ssim': 0.1,
'cs': 0.1,
'cnn': 0.1,
'dedup': 0.15
}
antidupe.set_limits(limits=new_thresholds)
# Check for duplicates
is_duplicate = antidupe.predict([image1, image2])
Requirements
- Python 3.x
- SSIM PIL
- ImageDeDup
- NumPy
- MatPlotLib
- Pillow
- ImageHash
- Torch
- Efficientnet Pytorch
- TorchVision
License
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
Metadata
Release files for antidupe 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| antidupe-0.0.8.tar.gz | 9.9 kB | Without provenance | Details for antidupe-0.0.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| antidupe-0.0.8-py3-none-any.whl | Python 3 | none | any | Details for antidupe-0.0.8-py3-none-any.whl |
Total release size: 20.3 kB
Release files / antidupe-0.0.8.tar.gz
| Download URL | antidupe-0.0.8.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a897f80942405bb215e2c012101438f494612c1c8623c14de972a05263492556
|
|
BLAKE2b-256 checksum How to use checksums |
7eba008048fdaf204acc3c2516327f1468f2bb9ad1dab30f9536add408573e89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / antidupe-0.0.8-py3-none-any.whl
| Download URL | antidupe-0.0.8-py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2221b557d1a08f7a826da898c257fbf3c422c2774cf91fb6a9b24345a359d9f4
|
|
BLAKE2b-256 checksum How to use checksums |
c1915cc7ac664796d7844cd37e02d1539851d9e20afeee0de8125835e38d7894
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Security for antidupe 0.0.8
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.