Skip to content

Fix SAM streaming visual tracking when prompts arrive mid-stream, add… - #2891

Draft
Mike-Medvedev wants to merge 1 commit into
mainfrom
mike/sam3-video-visual-tracking-fix
Draft

Fix SAM streaming visual tracking when prompts arrive mid-stream, add…#2891
Mike-Medvedev wants to merge 1 commit into
mainfrom
mike/sam3-video-visual-tracking-fix

Conversation

@Mike-Medvedev

Copy link
Copy Markdown

… prompt_frame_number to SAM3 video block.

The HF streaming session numbers frames internally from 0, but the video blocks registered visual prompts at the pipeline frame number. Whenever the two disagreed (pipeline numbering starts at 1), every streamed frame ran as an unprompted conditioning frame and the tracker emitted empty masks. Anchor prompt registration to the index the session assigns to the prompted image and stop forwarding the stream frame number from the blocks.

prompt_frame_number lets visual mode hold its prompts until the stream reaches a chosen frame: earlier frames emit no detections and leave the session untouched, so a track correction can prompt mid-clip without a trimmed upload.

What does this PR do?

Related Issue(s):

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other:

Testing

  • I have tested this change locally
  • I have added/updated tests for this change

Test details:

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in hard-to-understand areas
  • My changes generate no new warnings or errors
  • I have updated the documentation accordingly (if applicable)

Additional Context

… prompt_frame_number to SAM3 video block.

The HF streaming session numbers frames internally from 0, but the video
blocks registered visual prompts at the pipeline frame number. Whenever the
two disagreed (pipeline numbering starts at 1), every streamed frame ran as
an unprompted conditioning frame and the tracker emitted empty masks.
Anchor prompt registration to the index the session assigns to the prompted
image and stop forwarding the stream frame number from the blocks.

prompt_frame_number lets visual mode hold its prompts until the stream
reaches a chosen frame: earlier frames emit no detections and leave the
session untouched, so a track correction can prompt mid-clip without a
trimmed upload.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for the pull request! Here is how automated Claude review works here, so you spend credits (and reviewer time) wisely.

🚧 Right now this is a draft, so automated Claude review is paused — nothing is being spent yet. Mark it Ready for review to trigger it.

Warning

💸 The Claude reviewer bills in credits, not vibes

Automated review spins up a real agent that reads real code and spends real credits on every pass. It is glad to help — but it is not a rubber duck, a linter you poke in a loop, or a substitute for reading the contributing guide. Treat it like an expensive senior reviewer whose time you booked, and show up prepared.

Draft when unsure, Ready when you mean it:

  • 🌱 Not sure the PR is in good shape yet? Keep it (or set it back) as a draft — drafts pause review, so you can push and iterate without burning credits on a moving target.
  • 💪 Feel strong about the contents? Mark it Ready for review and the reviewer will take a look.

However you get there, arrive prepared:

  • 🧱 Bring a SOLID, thorough PR. Point your local agent at our skills/ to tune it to our guidelines first — or, if you are one of those fabled carbon-based contributors, read them yourself. A half-baked diff costs exactly the same to review as a finished one.
  • Resolve every comment before you re-request review. Re-requesting with threads still open means paying twice for the same conversation.
  • 🔁 Do not use CI review as an inner loop for a local agent. The reviewer is not a step-by-step debugger — do the unfolding locally and arrive with the answer, not the search.
  • 🙋 If something looks off, ask a human. One question to a maintainer is cheaper and faster than three rounds of agent re-review chasing a misread.

Reviews are not free. A draft costs nothing to review; a Ready PR is a promise that it is worth reviewing.

  • Prefer to skip automated review entirely? Add the skip-claude-review label.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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