Code Monkey home page Code Monkey logo

blackmonk13 / similar_images Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 43 KB

a Python command-line tool that identifies and groups similar images using average hashing. It supports single-level and recursive directory scanning, adjustable similarity threshold, and presents results in JSON format. Ideal for image deduplication, organization, and content-based retrieval tasks.

License: MIT License

Python 100.00%
command-line-tool concurrency content-based-image-retrieval image-comparison image-deduplication image-hashing image-hashing-algorithms image-processing image-similarity imagehash json multithreading pillow python

similar_images's Introduction

Similar Images

Status GitHub Issues GitHub Pull Requests License


This is a Python-based application designed to identify and group similar images within a specified directory. It utilizes image hashing, specifically average hashing, to compare images efficiently. The tool offers the flexibility to scan directories at a single level or recursively, depending on the user's needs. The similarity threshold can be adjusted to control the sensitivity of the comparison process. The results are presented in a JSON format, making it easy to understand and process the grouped images further.

๐Ÿ“ Table of Contents

๐Ÿง About

The primary purpose of the project is to address the challenge of identifying and organizing similar images within large datasets. Manually comparing and categorizing images can be a laborious and impractical task, especially when dealing with a significant number of images. By employing image hashing techniques, the project aims to streamline this process, making it more efficient and accurate. The tool can be particularly useful for image deduplication, image organization, and content-based image retrieval tasks, offering a valuable solution for individuals and organizations working with extensive image collections.

๐Ÿ Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

To get started with the Similarity Finder project, you need to have the following software installed on your local machine:

  1. Git - Download & Install Git
  2. Python (version 3.6 or higher) - Download & Install Python

Installing

Here's a step-by-step guide to help you set up a development environment for the Similarity Finder project:

  1. Clone the repository
git clone https://github.com/blackmonk13/similar_images.git
  1. Navigate to the project directory
cd similar_images
  1. Set up a Python virtual environment (optional but recommended)
python3 -m venv env
  1. Activate the virtual environment

On Windows:

.\env\Scripts\activate

On macOS and Linux:

source env/bin/activate
  1. Install the dependencies from the requirements.txt file
pip install -r requirements.txt
  1. Run the project using the command mentioned in the Usage section.

๐ŸŽˆ Usage

To use the Similarity Finder, run the following command in your terminal:

python -m similar_images -t 1 -r -o json -f output.json path/to/your/image/directory

Replace path/to/your/image/directory with the path to the directory containing images you want to analyze. The -t flag sets the similarity threshold (default is 10), the -r flag enables or disables recursive directory scanning, the -o flag sets the output format (default is json), and the -f flag specifies the path to the output file.

The application will output a JSON or CSV file containing groups of similar images found in the specified directory.

๐Ÿš€ Deployment

You can find the latest wheel (.whl) file in the release page. To deploy the project on a live system:

Unix-like systems (macOS, Linux)

Run the following command in your terminal:

curl -s https://api.github.com/repos/blackmonk13/similar_images/releases/latest | jq -r '.assets[] | select(.name | endswith(".whl")) | .browser_download_url' | xargs pip install

Windows

Open PowerShell and run the following command:

(Invoke-WebRequest -Uri "https://api.github.com/repos/blackmonk13/similar_images/releases/latest" -UseBasicParsing | ConvertFrom-Json).assets | Where-Object { $_.name -like "*whl" } | ForEach-Object { pip install $_.browser_download_url }

This command will install the project and its dependencies, allowing you to run the similar_images command directly from your terminal or Command Prompt without any hassle.

โ›๏ธ Built Using

โœ๏ธ Authors

See also the list of contributors who participated in this project.

Contributing

We welcome contributions from the community! If you'd like to contribute to Banner, please follow these steps:

  1. Fork the repository and create a new branch for your changes.
  2. Commit your changes and push them to your fork.
  3. Open a pull request against the main branch of the original repository.

Please make sure that your contributions adhere to the project's coding style and guidelines.

Before submitting a pull request, please make sure that:

  1. Your changes do not introduce any new bugs or regressions.
  2. Your code is well-documented and easy to understand.

similar_images's People

Contributors

blackmonk13 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.