Python package undouble
Project description
undouble
The aim of undouble
is to detect (near-)identical images. It works using a multi-step process of pre-processing the images (grayscaling, normalizing, and scaling), computing the image hash, and the grouping of images. A threshold of 0 will group images with an identical image hash. The results can easily be explored by the plotting
functionality and images can be moved with the move functionality. When moving images, the image in the group with the largest resolution will be copied, and all other images are moved to the undouble subdirectory. In case you want to cluster your images, I would recommend reading the blog and use the clustimage library.
The following steps are taken in the undouble
library:
- Read recursively all images from directory with the specified extensions.
- Compute image hash.
- Group similar images.
- Move if desired.
⭐️ Star this repo if you like it ⭐️
Blogs
- Read the blog to get a structured overview how to detect duplicate images using image hash functions.
Documentation pages
On the documentation pages you can find detailed information about the working of the undouble
with many examples.
Installation
It is advisable to create a new environment (e.g. with Conda).
conda create -n env_undouble python=3.8
conda activate env_undouble
Install bnlearn from PyPI
pip install undouble # new install
pip install -U undouble # update to latest version
Directly install from github source
pip install git+https://github.com/erdogant/undouble
Import Undouble package
from undouble import Undouble
Examples:
Example: Grouping similar images of the flower dataset
Example: List all file names that are identifical
Example: Moving similar images in the flower dataset
# -------------------------------------------------
# >You are at the point of physically moving files.
# -------------------------------------------------
# >[7] similar images are detected over [3] groups.
# >[4] images will be moved to the [undouble] subdirectory.
# >[3] images will be copied to the [undouble] subdirectory.
# >[C]ontinue moving all files.
# >[W]ait in each directory.
# >[Q]uit
# >Answer: w
Example: Plot the image hashes
Example: Three different imports
The input can be the following three types:
* Path to directory
* List of file locations
* Numpy array containing images
Example: Finding identical mnist digits
Citation
Please cite in your publications if this is useful for your research (see citation).
Maintainers
- Erdogan Taskesen, github: erdogant
Contribute
- All kinds of contributions are welcome!
- If you wish to buy me a Coffee for this work, it is very appreciated :)
Licence
See LICENSE for details.
Other interesting stuf
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
File details
Details for the file undouble-1.2.11.tar.gz
.
File metadata
- Download URL: undouble-1.2.11.tar.gz
- Upload date:
- Size: 17.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.27.1 setuptools/58.0.4 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c8345d5c196070e2ed347f0342fed4525e144be82046ba160f3716cf8572dd4 |
|
MD5 | b5d221c8699d1b2eafce7236d91b15dc |
|
BLAKE2b-256 | 24fa51558daf5a464b96a562a458a47a9811d993bd8f0bda66ae80e0afd5bca6 |
File details
Details for the file undouble-1.2.11-py3-none-any.whl
.
File metadata
- Download URL: undouble-1.2.11-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.27.1 setuptools/58.0.4 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75b1a2cdf173955a3fe087ec1cef3a98b88cf98c6ab07cba8f7683e0f950639c |
|
MD5 | f88288a35d7681709d88c2b9583f1250 |
|
BLAKE2b-256 | b2cb6ba385391834ca3180caf24633319d857de6844fe079e3b58a2fa16f6932 |