Imagededup is a Python package that simplifies finding exact and near-duplicate images in a collection. It offers various algorithms like perceptual hashing (PHash, DHash, WHash, AHash) and convolutional neural networks (CNNs) for robust deduplication. The package also includes an evaluation framework and plotting utilities for duplicates. The current version is 0.3.3.post2, and it maintains an active development cadence.
pip install imagededupVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use the Perceptual Hashing (PHash) method to find duplicate images in a specified directory. It involves initializing the hashing method, generating image encodings, and then finding duplicates based on these encodings. The example includes creating a dummy directory and files for immediate execution.
Upgrade your Python environment to 3.9 or newer.
Re-generate CNN encodings for your image collection when upgrading from older versions. Also, similarity thresholds might need adjustment for optimal performance with the new encodings.
Re-generate all image hashes if upgrading from a version older than 0.3.0.
For very large datasets, consider using approximate nearest neighbor libraries (e.g., FAISS) or alternative strategies if memory becomes a bottleneck. Benchmarking with your specific dataset is recommended.
Experiment with different threshold values for your specific dataset. The documentation suggests `min_similarity_threshold` around 0.9 for CNNs and `max_distance_threshold` of 0 for exact duplicates with hashing methods.
Install the package using pip: `pip install imagededup`
Install Microsoft Visual C++ Build Tools 14.0 or greater (available from visualstudio.microsoft.com/visual-cpp-build-tools/) or try installing 'imagededup' within a clean virtual environment where dependencies can be managed without conflicts.
Verify that the image file path is correct, ensure the image is not corrupted, and confirm that its format is supported by Pillow (e.g., JPEG, PNG). Sometimes, restarting the runtime or ensuring sufficient memory can resolve transient issues.
Convert the Python list to a NumPy array before attempting to use `.astype()`: `import numpy as np; your_array = np.array(your_list).astype(desired_type)`.
Install a compatible version of TensorFlow manually before installing 'imagededup' (e.g., `pip install tensorflow==<compatible_version>`), or install 'imagededup' in a clean virtual environment to allow it to install its preferred TensorFlow dependency without conflicts.
No dependency data recorded yet.