/embeddings-grid

Spring Boot Server that implements a self-organizing-map to turn a list of images with embeddings to a 2D image grid. It implements LAS/FLAS described in the paper "Improved Evaluation and Generation of Grid Layouts using Distance Preservation Quality and Linear Assignment Sorting" from 2022 as sorting algorithm.

Primary LanguageJavaApache License 2.0Apache-2.0

Arrange images grid server

Spring Boot Server that implements a self-organizing-map to turn a list of images with embeddings to a 2D image grid. It implements LAS and FLAS described in the paper Improved Evaluation and Generation of Grid Layouts using Distance Preservation Quality and Linear Assignment Sorting from 2022 as sorting algorithm.

Made by pixolution GmbH, Berlin as part of the xCurator research project. The embeddings-grid project code is available under the Apache License 2.0. See the LICENSE file for more info.

Getting started

The API is defined in openapi/openapi.yaml. OpenAPI Generator is used to generate spring boot 2.7.6 java source code (spring 5.3.24).

Re-generate spring java source from openapi specification

./gradlew --warning-mode all openApiGenerate
  • To directly generate and copy the sources
./renew_openapi_from_spec.sh

Using the project

  • Start local test server
./gradlew bootRun
  • view api documentation: http://127.0.0.1:8080
  • do a test query using curl and examples/request.json file
curl -X 'POST' \
  'http://127.0.0.1:8080/sort' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d @examples/request.json
  • Run tests
./gradlew test
  • Build and run production docker image (requires docker locally installed)
./gradlew docker
docker run -p8080:8080 embeddings-grid:latest

Examples

The examples/ contains a response and request json example and a HTML visualization of the results. The embedding used in the examples is a color embedding developed by pixolution GmbH, Berlin and is not part of this project.