Docker Image Interface specification
  • 15 Feb 2023
  • 2 Minutes to read
  • Dark
    Light
  • PDF

Docker Image Interface specification

  • Dark
    Light
  • PDF

Article summary

This article describes the interface specification for all types of docker images.

Thumbnail generator

Input locationThe input images are presented at location /input/i1, with multiple images(1000+) presented at this location.
Output locationThe docker is expected to produce thumbnails at /output/o1. There should be 1 thumbnail file generated per input file in /input/i1, and the name of the output file must exactly match the name of the input file path relative to the input location. For e.g. If the input file is at /input/i1/dir1/a.jpg, then the output thumbnail must be produced at /output/o1/dir1/a.jpg.
Output formatCommon formats like PNG and JPG are recommended. Irrespective of the output format, the filename must exactly match the filename of the input file.
Other details
  • The aspect ratio of the thumbnail should preferably match that of the input image.
  • The resolution of the thumbnail should be sufficient to provide good visual clarity on the UI. The default provided thumbnail generator produces thumbnails at a resolution of 192x108 pixels.
  • The thumbnail size should preferably be limited to under 20KB per thumbnail.

Pre-processor

Input locationThe input images are presented at location /input/i1, with multiple images(1000+) presented at this location.
Output locationThe docker is expected to write images after pre-processing to /output/o1. There should be 1 output file generated per input file in /input/i1, and the name of the output file must exactly match the name of the input file with file path relative to /input/i1 preserved.
e.g. If the input file is at /input/i1/dir1/a.jpg, then the output file should be at /output/o1/dir1/a.jpg.
Output formatSame as the input format
Other details
  • The output image is expected to be at the same resolution as the input image.

Featurizer

Input locationThe input images are presented at location /input/i1, with multiple images(1000+) presented at this location.
Output locationThe docker is expected to produce output to /output/o1. There should be 1 output file generated per input file in /input/i1, and the name of the output file must be <input_file_name>.npy, and the file path relative to /input/i1 must be preserved.
e.g. If input file is at /input/i1/dir1/a.jpg, then the output file should be at /output/o1/dir1/a.jpg.npy.
Output formatThe featurizer must produce output in one of the following forms
  • As a 1D float numpy array of dimension F where F represents the number of features per image.
  • As a 3D float numpy array of dimension (M, N, F) with M, N representing cells of an MxN grid over the image. The list of F features at position (I, J) must capture the features corresponding to cell (I, J) of the MxN grid over the image.

In either of the cases, the output file must be produced as a numpy file using numpy.save() or equivalent routine.

Other details
  • Patch search is supported only if the featurizer produces a 3D output.
  • The output of the featurizer will automatically go through a dimensionality reduction.
  • Since the input directory is expected to hold around 1000+ images, processing in batches will likely produce higher throughput than processing one image at a time.

Attribute generator

Input locationThe input images are presented at location /input/i1, with multiple images(1000+) presented at this location.
Output locationThe output must be produced to /output/o1 with a single CSV file as the output. The CSV file can have any name with an extension of .csv
Output format
  • The CSV file must contain a header row with a specific column named file_path followed by other column names.
  • The file_path column must store the input file name relative to /input/i1, and the other columns must store the attributes for the file.
  • The number of rows per file can be >=0, and hence 1 file with multiple values for an attribute and a file with no attributes are supported.

Was this article helpful?