Skip to main content
Label a few images by hand and every new image gets the label of its closest example. Images with no close enough example are listed for review, and each one you label improves the next match.

Jump to the manifest

bootstrap-labeled-dataset.namespace.yaml: apply it with one API call, then read the walkthrough below to change it.

At a glance

How the pieces connect

Buckets hold what you upload, collections turn it into searchable documents, and retrievers answer queries over the collections.

Deploy it

1

Get the manifest

2

Validate it

Validate runs every check apply runs and creates nothing. Fix each entry in errors, then run it again.
3

Apply it

Apply creates every resource in one call. wait_for_seed=true also waits until the sample objects are processed, so the first query below has documents to return.
The response lists each resource with its outcome in resources. Apply refuses a resource that already exists and rolls the whole apply back, so to apply the file again over this namespace add ?mode=create_missing, which creates only what is missing.

Run the first query

Look up the namespace id by name, then run image-search. Check status and warnings along with documents: a run that times out still answers 200, with status degraded.

Add your own data

Each object you add to a bucket is processed by every collection that reads it. This adds one object to incoming-images. NAMESPACE_ID is the id from the namespace lookup above.
The object is PENDING until processing finishes, then COMPLETED or FAILED. Buckets and objects covers object states, retries and duplicates.

Retrievers

label-lookup

The taxonomy’s matcher: the reference example closest to an image’s vector, if it scores at least min_score. Stages: feature_search Searches: reference-set Text-to-image search over the incoming images. Each result carries the scene_label it was given. Stages: feature_search Searches: incoming

needs-review

Incoming images the taxonomy could not label: no reference example scored at least min_score. Stages: attribute_filter Searches: incoming

Collections

Each collection runs one extractor over a bucket, or over another collection’s documents.
image_extractor@v1 over bucket reference-images. The examples scene-labeler matches against.Reads bucket reference-images with image_extractor v1.Inputs: image ← imageCopied onto each document: scene_label
image_extractor@v1 over bucket incoming-images. Labeled by scene-labeler; feeds image-search and needs-review.Reads bucket incoming-images with image_extractor v1.Inputs: image ← image

Also created

Taxonomies
  • scene-labeler: Copies scene_label from the closest reference example onto each incoming image.

The manifest

Every resource above comes from this file. Change it and apply it again with ?mode=upsert to update what exists. Manifests documents each field.
bootstrap-labeled-dataset.namespace.yaml

Hand it to an agent

Paste this prompt into Claude Code, Cursor or another coding agent. To give the agent this whole page instead, use Copy page in the menu at the top of the page, or point it at the page’s Markdown at https://mixpeek.com/docs/templates/bootstrap-labeled-dataset.md.
Prompt

How it works

You label a few images by hand. Every new image then gets the label of the labeled image it looks most like, and the ones that look like nothing you labeled wait for a person.
  1. reference-set embeds each image in reference-images with image_extractor (SigLIP, 768 dimensions) and copies its scene_label onto the document. These are your labeled examples.
  2. incoming embeds each image in incoming-images with the same extractor. Both collections write the same feature, so their vectors are comparable.
  3. incoming applies the scene-labeler taxonomy. As each incoming image is processed, the taxonomy reads the image’s stored vector (image_extractor_v1_embedding) and passes it to label-lookup as query_embedding.
  4. label-lookup searches reference-set with that vector and returns the single closest example, if it scores at least min_score (0.30). The taxonomy copies that example’s scene_label onto the incoming document.
  5. When no example scores 0.30 or more, the image gets no scene_label. needs-review lists those images with an attribute_filter on scene_label exists false.
Apply does not wait between the two seed batches. An incoming image processed before the reference set is indexed comes out unlabeled; step 4 below labels it again.

The labeling loop

1

Count what was labeled

Group the incoming documents by scene_label. Documents with no label form their own group.
cURL
2

List the images that need a label

needs-review takes no inputs. Each document id it returns is an image to look at and label.
cURL
3

Teach it a new example

Editing an object does not reprocess it, so add each example as a new object in reference-images, with auto_process=true. Replace the URL with your image.
cURL
4

Label the incoming images again

To relabel the images already in incoming against the grown reference set, apply the taxonomy to the collection with reapply_all: true. The call returns a task.
cURL
Poll GET /v1/tasks/{task_id} until status is COMPLETED, then run step 1 again.

Why these settings

  • The same extractor on both sides. The taxonomy compares an incoming vector with reference vectors, so both collections must write mixpeek://image_extractor@v1/google_siglip_base_v1.
  • min_score: 0.30 on label-lookup. The taxonomy has no threshold of its own. A match below the retriever’s floor returns nothing, so the image stays unlabeled. Raise it for precision, lower it for coverage, and pick it by checking samples from needs-review and from the labeled images.
  • top_k: 1. Each image takes the label of its single nearest example.
  • merge_mode: replace. A relabel overwrites the old scene_label.
  • scene_label is required on reference-images. An example without a label would still match and copy nothing.
  • A separate reference set. Auto-labels never become examples, so one wrong label cannot spread.

Variations

Each change below edits the manifest. Apply it again with ?mode=upsert.

Add a category

A category exists once one example carries it. Add a few objects to reference-images with the new scene_label (step 3), then relabel incoming (step 4). Nothing in the manifest changes.

Label text documents

Swap the extractor on both collections and point the taxonomy at the text vector. The bucket property holding the text becomes a text type, for example content.
collections (both) feature_extractor
label-lookup searches
scene-labeler input_mappings
Change the namespace’s feature_extractors entry to text_extractor as well.

Get an email when an image needs a label

An alert runs a retriever each time a document is written and fires when it returns documents. Alerts run after taxonomies, so this retriever sees the label already in place.
retrievers (add)
alerts (add)
incoming collection (add)
The email goes to the address under Settings, Notifications. See Alerts for webhook and Slack channels.

Find categories you have not labeled yet

Cluster incoming on the same feature, run it, and label a few members of each group in reference-images. Hierarchical cluster search shows how to run a cluster.
clusters (add)