Skip to content

Label by Example in Project.autolabel and the CLI - #595

Merged
iurisilvio merged 3 commits into
iuri/autolabel-workflow-jobsfrom
iuri/autolabel-reference-examples
Dec 3, 2026
Merged

iurisilvio merged 3 commits into
iuri/autolabel-workflow-jobsfrom
iuri/autolabel-reference-examples

Conversation

@iurisilvio

Copy link
Copy Markdown
Contributor

What does this PR do?

Label by Example from the SDK and the CLI: show the model up to 10 labeled images of the project, with their boxes, before every image it labels.

roboflow/roboflow#20350 opens Label by Example on the public Auto Label API: referenceExamples: [{"imageId": "..."}] on the start and preview routes, and takesReferenceExamples in the models list. The server reads each image's boxes of the job's classes from the project.

Changes

  • Project.autolabel(..., reference_examples=[...]) and Project.autolabel_preview(..., reference_examples=[...]) take the image ids; rfapi sends them as referenceExamples. A single id string is one example, not one per character.
  • roboflow autolabel start and preview take --reference-example <image-id>, repeated for up to 10.
  • roboflow autolabel models adds an EXAMPLES column, and Workspace.autolabel_models() documents takesReferenceExamples.
  • Changelog entry, and an example in CLI-COMMANDS.md.
project.autolabel(
    "batch-1",
    model="gemini-4-argon-boxes",
    ontology={"a green umbrella": "umbrella"},
    reference_examples=["image-id-1", "image-id-2"],
)
roboflow autolabel start -p umbrellas --batch-id batch-1 -m gemini-4-argon-boxes \
  --ontology '{"a green umbrella": "umbrella"}' --reference-example image-id-1 --reference-example image-id-2

An example must be in the project's dataset (not only in a batch or in review) with a box of the job's classes. Otherwise the API answers REFERENCE_EXAMPLE_NOT_FOUND (404) or INVALID_REFERENCE_EXAMPLES (400), the same for an image of another project. The SDK passes those errors on as they are.

Merge order

Testing

  • New tests for the payload, the Project methods, the CLI flags and the models table. The Auto Label suites pass (55 tests); ruff and mypy are clean.

🤖 Generated with Claude Code

iurisilvio and others added 3 commits November 30, 2026 19:47
Project.autolabel and autolabel_preview take reference_examples, the ids of
labeled images of the project the model sees as examples, and the CLI takes
--reference-example on start and preview. autolabel models marks the models
that take them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ples

Brings in main (with the squash of #593 recorded) through #594's branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@iurisilvio iurisilvio self-assigned this Dec 2, 2026
@iurisilvio
iurisilvio requested a review from a team December 2, 2026 11:03
@iurisilvio
iurisilvio merged commit 482c1e5 into iuri/autolabel-workflow-jobs Dec 3, 2026
3 checks passed
iurisilvio added a commit that referenced this pull request Dec 3, 2026
1.7.5 was released without #594 and #595, and the merge of main put their
entries under it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants