erdogant / undouble

Python package undouble is to detect (near-)identical images.
BSD 3-Clause "New" or "Revised" License
45 stars 0 forks source link
ahash dhash doubles-detector hash image image-recognition image-similarity phash photos wavelet

undouble

Python PyPI Version License Github Forks GitHub Open Issues Project Status Sphinx Downloads Downloads Sphinx

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:

⭐️ Star this repo if you like it ⭐️ #

Blogs

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

Contribute

Licence

See LICENSE for details.

Other interesting stuf