Skip to content

etsuko-io/self-org-maps

Repository files navigation

Self Organizing Maps

This app takes an image and transforms it into a new image, containing the original colors of the input image, but organized by color. The process is based on the self-organizing maps algorithm by Teuvo Kohonen.

Example 1

Input

input-image1

Output

output-image1

Example 2

Input

input-image2

Output

output-image2

Preparing training data

Large images take a long time to process, because they contain a huge amount of pixels. Therefore, a tool is included to resize the images.

  • The first argument provides a path to a directory with one or more images.

  • The second argument sets the desired amount of total pixels in the resized image.

    $ python -m src.som.tooling.resize

e.g.:

$ python -m src.som.tooling.resize ~/Desktop/images <pixels>

Image to base64

Execute generation process with CLI command

$ python -m src.som.api.views.cli <blueprint-json-path>

Project Architecture

Overview

The project is comprised of two main components: an API and Celery for processing. It is designed to be deployed to AWS and can be interacted with through the API to process images.

Components

  • API: The entry point for interacting with the project.
  • Celery: Used for processing images.
  • SQS: Used for queue management in Celery.

Workflow

  1. A user makes a request to the API to process an image.
  2. The API offloads the processing to Celery.
  3. Celery processes the image and stores the result in an S3 bucket.
  4. Once processing is complete, the API sends an email with a link to the result.

Example Request

An example of a request can be found in the quickstart folder.

Development

  • Run pre-commit install to install the pre-commit hook

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published