Repository navigation
[ar-api] Add CLI video segment annotation (VID-59) - #544
Closed
digaobarbosa wants to merge 5 commits into
Closed
digaobarbosa wants to merge 5 commits into
digaobarbosa wants to merge 5 commits into
Conversation
…(VID-59) Route annotate rejections through output_api_error so a rejected key exits 2, and give the video-coco hint only to 400s instead of transport failures. Fold the annotate CLI tests into table-driven cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without an explicit encoding, Windows decodes the file with its locale codepage and silently corrupts non-ASCII class names. A file in another encoding (e.g. UTF-16 from PowerShell redirection) now gets an actionable hint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Motivation
Action Recognition users can upload a native video from the CLI, but they could not submit its segment labels there. They had to switch to Python for the last step.
roboflow video annotatereads one complete video-coco document and sends it unchanged to the video ID thatvideo uploadreported. Native frame indices, uneven timestamps and the rational time base stay exactly as written. Users can pick a Dataset split, request--overwrite, and turn Dataset membership on or off. Without a membership flag, the API default applies: the video is added.A conflicting save tells the user to re-run with
--overwrite. An unknown video exits 3, and a rejected API key exits 2. The file is read as UTF-8 on every platform, so non-ASCII class names stay intact on Windows.Stack and dependency
This draft targets
bc/VID-53/ PR #541, which targets the SDK dependency PR #534. Merge #534 and #541 first. This PR includes #541's latest fixes through merge commits.Verification
At head
bb80ce8(macOS, Python 3.12):ruff check,ruff format --checkandmypy roboflowpass.api.roboflow.one/model-evaluation-workspacewith the installed CLI. That is 9 upload/status cases from [ar-api] Add native video upload and ingestion status to CLI (VID-53) #541 and 15 annotate cases. Segments were read back through the SDK. The run used its own private Action Recognition project, then moved it to Trash and confirmed it was gone..github/workflows/test.ymlruns its Python/Windows matrix only for PRs intomain, so it does not run here.Staging E2E results — annotate (head bb80ce8, 2026-10-05; also 24/24 at 2508af6)
RF="roboflow --json -k $KEY -w model-evaluation-workspace". A and B are fresh Sources from byte-unique stream copies of real 24 fps clips (time base 1/12288). The documents are realroboflow-video-cocoexports.roboflow video annotate --help-a -i -p,--add-to-dataset/--no-add-to-dataset,--overwrite,-s$RF video annotate -a a.json -i <A> -p $P{"success": true, "inDataset": true, "createdClasses": ["hook", "punch"]}createdClasses: [], no--overwriteneeded$RF video annotate -a a_conflict.json -i <A> -p $Palready has annotations; hintRe-run with --overwrite… --overwriteroboflow -k $KEY … video annotate …Annotated video <A>./In dataset: yes$RF video annotate -a b.json -i <B> -p $P --no-add-to-datasetinDataset: false… --add-to-dataset -s validinDataset: trueproject.image(<A>),project.image(<B>)validwith 2 segments… -i doesnotexist123Video not found; hint namesroboflow video upload… -a a_empty.jsonThe roboflow-video-coco document has no segments… -a bad.jsonInvalid JSON …… -a nope.jsonCannot read annotation file… -p no-such-project-xyzroboflow --json -k bogus … video annotate …This API key does not exist(exited 3 before this head)The upload/status cases U1–U9 match the table in #541 and passed at this head too.
Notes
duplicate: trueand links the existing Source into the new project. Annotating that Source changes every project that holds it. An early E2E pass overwrote one segment of a shared staging project this way. It was restored from the original export and verified, and the E2E now refuses deduplicated uploads.--no-add-to-datasetonly skips adding. It does not remove a video that is already in the Dataset.--helphint. The sharedoutput_errorlets a server hint win for every command, so it is out of scope here.🤖 Generated with Claude Code