Skip to content

[ar-api] Annotate Action Recognition video segments from Python (VID-36) - #534

Draft
digaobarbosa wants to merge 2 commits into
mainfrom
bc/VID-36
Draft

digaobarbosa wants to merge 2 commits into
mainfrom
bc/VID-36

Conversation

@digaobarbosa

Copy link
Copy Markdown
Contributor

Action Recognition users can upload a video but cannot yet send temporal labels through the Python SDK. Their final uploaded video ID is the one the platform will annotate, especially when upload reuses an existing Source.

This adds a project method that sends an official video-coco document to the public annotation API. It forwards native PTS, frame indices, and rational time base unchanged, and exposes only the API's overwrite, split, and Dataset membership choices.

The method returns the server's success body and raises the server's error message and HTTP status for rejected writes. An identical retry succeeds; a conflicting replacement stays a 409 until the caller opts into overwrite.

Validation

  • python -m unittest tests.test_video_segment_annotation tests.test_rfapi tests.test_project -q: 63 passed. The three new tests call Project.annotate_video_segments against isolated responses request fixtures, covering HTTP 200 acceptance and retry, HTTP 409 preservation, explicit overwrite/split/Dataset options, HTTP 400 validation, and a transport failure. These fixtures verify SDK behavior, not platform execution.
  • Ruff check and format check passed for changed Python files; mypy passed for both changed source files; git diff --check passed.
  • Staging GET https://api.roboflow.one/model-evaluation-workspace/punch-hook-actions/annotate returned HTTP 200 on 2026-10-01, but its instructions had no video entry. Platform master at bad84a289e3e69008039b52ea12d6b93f4c7134c has no video annotate branch. No staging video POST or end-to-end approval was attempted.

Prerequisites and rollout

  • roboflow#16456 provides atomic segment and class saves.
  • roboflow#16236 provides the API-key video annotate route; it is stacked on #16456. Both are open at this draft's creation.
  • Deploy the platform API after those PRs merge, along with their required light-v2-datasets and heavy-v2-upload functions, before live SDK verification. This SDK PR does not deploy the server.
  • The separate VID-35 upload path supplies the final uploaded-status videoId, which may differ from its initial reservation ID. This PR has no dependency on VID-35 code.

This branch has not been deployed

No deployments
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.

1 participant