[ar-api] Upload native Action Recognition videos (VID-35) - #535
Merged
Merged
Conversation
digaobarbosa
marked this pull request as ready for review
October 2, 2026 11:38
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.
Description
Action Recognition users can create and train projects through the SDK, but could not upload a native video for annotation. Existing video calls extract frames or run inference rather than creating a video Source in a dataset.
Project.upload_video("clip.mp4")now streams the original bytes through the platform's signed upload flow and returns processing status. Callers can poll or use a bounded wait, then use the finalvideoIdas the Source ID. Ingestion may deduplicate onto an existing Source. The call forwards the API's batch, tags, metadata, and split options; image uploads and their retry behavior are unchanged.Validation
python -m unittest tests.test_native_video_upload tests.test_project— 42 passed, including public SDK calls against loopback HTTP for original-byte PUT, canonical status, delayed status timeout, transport errors, and existing image uploads. Ruff format/check, mypy on changed modules, andgit diff --checkpassed.4933744cff7ad99e298c46dc26f089d515b59a00, 2026-10-02 11:25:20–11:25:43 UTC,model-evaluation-workspaceviaapi.roboflow.one: an owned private Action Recognition project uploaded a 24,523-byte MP4 withwait=Trueand a 37,771-byte MOV withwait=False, explicitget_video_upload_status, then boundedwait_for_video_upload. Both preparation requests and signed GCS PUTs returned HTTP 200; the observer confirmed complete fixture stream consumption. Both reacheduploadedand resolved to batch7mwvVebZ3zfsReTf0jon.g5uxMmLMPEbRkVmMHl4P. PublicProject.imageread both Sources asmediaType=video; MP4 tag, metadata andsplit=trainwere read back. Public annotation batches reportedmediaType=videofor the task batch. Reuploading the owned MP4 sent its full bytes again, then returnedduplicate:true, the original canonical Source ID, andresolvedBatch:null.vid44-native-mp4andvid44-native.mov, each0:02. Playback and annotation were not exercised. Dataset/videosbrowse was empty because these Sources were not annotated into the dataset.yckFzKF1RHup4Tmy24FU. No shared Source or GCS object was deleted; task-only files were removed.Sanitized SDK call shape (supply the key privately as
$STAGING_API_KEY):Platform contract and runtime limit
The direct upload API prepares a signed URL and required headers, then reports pending, uploaded or failed status with the canonical Source ID after ingestion. This PR changes only the native video SDK upload path; image upload retries and segment annotation are outside its scope.
Staging upload, finalization and public Source readback are verified at this exact SDK head. Production/EU deployment, playback, segment annotation, and stored GCS byte hashing were not tested. Requests timeouts limit connection/read inactivity, not the total wall time of a slowly streaming response;
poll_timeout=0makes one status request with the default transport timeout. This PR does not deploy the platform route or publish a package.