Skip to content

imgdedup

Simple Python script to detect exact and near duplicates in an image collection, using the imagededup library. It is basically just a wrapper around such library.

Inspired by PR idealo/imagededup#47 on 2025-05-16.

Usage

Important: this has been tested with Python 3.12.4 on Windows 10.

Set up a Python venv (virtual environment) and install some packages inside it:

Bash
python3 -mvenv venv
venv/bin/python3 -mpip install -r requirements.txt

Then you can use the script like this:

Bash
1
2
3
4
5
time venv/bin/python3 main.py -mPHash images/
time venv/bin/python3 main.py -mCNN -Ss.8 images/

time venv/bin/python3 main.py -mCNN -Ss-1 images/ output-01.json
jq 'map_values(map(select(.[1] | tonumber > 0.9))) | with_entries(select(.value | length > 0))' output-01.json > output-02.json