Skip to main content
POST
Upload Custom Index
Click for Python SDK
This endpoint allows users to upload custom image embedding vectors to use as the feature space for Autotag and similarity search. A well-formed embeddings file must contain an entry for every image in the dataset, and all embeddings must have the same dimensions. A good embedding is a strong semantic descriptor for an image, usually a pre-activation output of a neural network layer.

Formatting an Embedding File

The files must be in JSON format, and each file should contain no more than 5,000 embedding vectors. The JSON objects are expected to have the following format: each key is a string reference_id uniquely identifying a DatasetItem, and each value is a list of floats. Numpy arrays must be converted to lists in order to serialize the JSON file. The vectors must all have the same dimension/length. The entries of the JSON object must be exhaustive, meaning that every Dataset Item in the dataset is represented in the keys. This implies that if your Dataset contains 5,000 images, the JSON object represented across the embedding files are also expected to have length 5,000.

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

dataset_id
string
required

The Scale-generated ID of the Dataset.

Body

application/json
embeddings_urls
string[]
required

Array of URLs each pointing to a JSON embeddings file. Each JSON provides a mapping from reference_id to the corresponding embedding vector. See Formatting an Embedding File.

embedding_dimension
integer<int32>
required

The dimension of each embedding vector. All embeddings must have the same dimension.

Response

200

dataset_id
string
Example:

"ds_by0a81gnf6gfy9hw6rpg"

job_id
string
Example:

"job_c19xcf9mkws46gah00yg"

job_last_known_status
string
Example:

"Running"

job_type
string
Example:

"ingestTasks"

job_creation_time
string
Example:

"2021-07-20T18:07:13.055Z"

message
string
Example:

"Processing embeddings in the background. You can use the job_id field to asynchronously check the status of this indexing job."