Repository navigation
Auto Label with a saved Workflow from the SDK and the CLI - #594
Open
iurisilvio wants to merge 10 commits into
Open
iurisilvio wants to merge 10 commits into
iurisilvio wants to merge 10 commits into
Conversation
Project.autolabel(size_filter=...) and `roboflow autolabel start --min-width/--max-width/--min-height/--max-height` send the API's sizeFilter, which drops labels whose box is outside those sizes. The Auto Label docs now cover the catalog's keypoint models (gemini-4-argon-keypoints, ...), which ignore keypoint_confidence_threshold, and use listed model ids in examples (gpt-6-astra-boxes is unlisted since GPT-6.2 Astra replaced it). `autolabel models` shows the project types each model labels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Project.autolabel(model="<workflow-url>", model_type="workflow", workflow_output=..., class_mapping=...) and `roboflow autolabel start --model-type workflow --workflow-output ... --class-mapping ...` start the public route's saved-Workflow job (modelType "workflow"), which neither client could send before. The route requires workspaceName, selectedOutputName, classMapping and a numeric threshold for every class the mapping writes, and it does not fan defaultConfidence out for a Workflow job. So the adapter sends the route's workspace as workspaceName, and `confidence` (0.5 when omitted, the web app's start value) is fanned out over the mapped project classes unless confidence_thresholds is given. A Workflow job without an output or a class mapping, or a Workflow option on another model type, is a ValueError before any request: a catalog model's job would otherwise take a classMapping it was not meant to get. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#593 merged into main as the squash 444db7a, whose tree equals its last head c5b1580, which this branch already has. Merging it with -s ours changes no file and moves the merge base past the squash, so the merge of main below conflicts only where main changed since. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
iurisilvio
changed the base branch from
iuri/autolabel-sync-size-filter-keypoints
to
main
December 2, 2026 10:18
The PR now targets main; the retarget alone does not start the test workflow, which runs only for pull requests into main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Take Label by Example's reference examples in the SDK and the CLI 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> * Link the Label by Example changelog entry to #595 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
The public start route (
POST /:workspace/:project/autolabel) already takes these jobs the way the web app sends them:modelType: "workflow"withworkflowId,workspaceName,selectedOutputName,classMapping,inputValuesandimageInputName. The SDK could not send any of them.Changes
Project.autolabel(..., model_type="workflow")takes the Workflow's URL slug asmodel(theurlcolumn ofroboflow workflow list),workflow_output(the output that holds the predictions) andclass_mapping({workflow class: project class}), plus the optionalworkflow_inputsandworkflow_image_input.rfapi.start_autolabel_jobsends them asworkflowId,selectedOutputName,classMapping,inputValuesandimageInputName, withworkspaceNameset to the workspace in the URL (the API resolves the Workflow there).defaultConfidence. Soconfidence(0.5 when omitted, the web app's default) is applied to each mapped class unlessconfidence_thresholdsis given.roboflow autolabel starttakes--workflow-output,--class-mappingand--workflow-inputs(inline JSON or@file), and--workflow-image-input.workflow_outputorclass_mapping, or Workflow options with another model type, raisesValueErrorbefore any request (exit 1 in the CLI).CLI-COMMANDS.mdgets an example. The changelog entries of this PR and of Label by Example in Project.autolabel and the CLI #595 are under a new## Unreleased, because 1.7.5 was released without them.roboflow autolabel start -p cars --batch-id batch-1 -m vehicle-detector --model-type workflow \ --workflow-output predictions --class-mapping '{"car": "vehicle", "truck": "vehicle"}' --confidence 0.4The job runs the Workflow's published version, not its draft. The API checks that the Workflow and its output exist before it creates the job (
WORKFLOW_UNAVAILABLE, no credits used). An OAuth app limited to project folders cannot start a Workflow job (FOLDER_SCOPED_TOKEN_REFERENCE); the SDK signs in with API keys, so this does not affect it.The MCP server gets the same changes in roboflow/roboflow-mcp#398. The docs are roboflow/docs#716 (saved Workflows) and roboflow/docs#717 (Label by Example), both merged.
Label by Example (#595)
roboflow/roboflow#20350 (merged 12-01) opened Label by Example on the public Auto Label API:
referenceExamples: [{"imageId": "..."}]on the start and preview routes, andtakesReferenceExamplesin the models list. The server reads each image's boxes of the job's classes from the project.Project.autolabel(..., reference_examples=[...])andProject.autolabel_preview(..., reference_examples=[...])take the image ids;rfapisends them asreferenceExamples. A single id string is one example, not one per character.roboflow autolabel startandpreviewtake--reference-example <image-id>, repeated for up to 10.roboflow autolabel modelsadds anEXAMPLEScolumn, andWorkspace.autolabel_models()documentstakesReferenceExamples.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) orINVALID_REFERENCE_EXAMPLES(400), and the SDK passes those errors on as they are.Not in this PR
autolabel_previewtakes catalog models only.Testing
python -m unitteston bc65444, with main (1.7.5) merged in: 1331 tests pass (1 skipped), including new ones forresolve_workflow, the request bodystart_autolabel_jobsends,Project.autolabelwith Workflow options, and the CLI (mapping from@file, threshold fan-out, missing output, Workflow flags on a foundation model), and for the examples payload, theProjectmethods, the--reference-exampleflag and the models table.make check_code_quality(ruff and mypy) is clean.workflowJobFields.jsandfindWorkflowClassMappingErrorin the monorepo).🤖 Generated with Claude Code