GithubHelp home page GithubHelp logo

kaywuensche / clustering_images Goto Github PK

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

API for grouping images on similarity.

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
api docker no-code cpu clustering image imagefile image-analysis image-viewer kmeans elbow-method image-processing downloader pca

clustering_images's Introduction

Clustering Images

API for grouping images on similarity.

Optional you can sample your image set based on clusters. Sampling your images makes sense if you have a hugh amount of them and wanna label only a subset by using an image labeling tool.

Prerequisites:

  • docker
  • docker-compose

Check for prerequisites

To check if docker-ce is installed:

docker --version

To check if docker-compose is installed:

docker-compose --version

Install prerequisites

Ubuntu

To install Docker and Docker Compose on Ubuntu, please follow the link.

Windows 10

To install Docker on Windows, please follow the link.

Build The Docker Image

In order to build the project run the following command from the project's root directory:

sudo docker-compose up --build

API Endpoints

To see all the available endpoints, open your favorite browser and navigate to:

http://<machine_IP>:5002/docs

overview

You can change the port in the docker compose file.

/download_web_images (POST)

This endpoint takes a search query and downloads corresponding images from google, bing and yahoo.

Images will be saved to the mounted input directory, which can be changed in the docker compose file:

├──exchange/
    ├── input/
        ├── *.jpg
        ├── *.jpeg
        ├── *.png

The endpoint returns an overview of all downloaded images. For example when searching for 'germany':

overview

/get_amount_of_clusters (POST)

This endpoint takes the image set from the mounted input directory and returns the result of the elbow method for choosing the best amount of clusters:

elbow19

Please place files in the mounted input directory.

├──exchange/
    ├── input/
        ├── *.jpg
        ├── *.jpeg
        ├── *.png

/cluster_images (POST)

This endpoint takes the image set from the mounted input directory and groups them based on similarity.

In addition you have the opportunity to get a sample of your image set by choosing x percentage of each image cluster.

Please place files in the input directory. The output directory will be generated automaticly:

├──exchange/
    ├── input/
    │   ├── *.jpg
    │   ├── *.jpeg
    │   ├── *.png
    │
    ├──output/
        ├── cluster_0/
        │   ├── *.jpg
        │   ├── *.jpeg
        │   ├── *.png
        ├── cluster_1/
        │   ├── *.jpg
        │   ├── *.jpeg
        │   ├── *.png
        ├── sample/
            ├── *.jpg
            ├── *.jpeg
            ├── *.png

The endpoint returns an overview of the image clusters:

cluster19

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.