Merged
Conversation
… updates as the sam-3 repo is abit janky
…there is better memory management. There is still some quality issues with the video implementation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR integrates SAM-3 (Segment Anything Model 3) video segmentation capabilities into the codebase, enabling video-to-video segmentation with text prompts. The implementation uses a specific commit from the transformers library and adds both video and updated image processing capabilities for SAM-3.
- Added SAM-3 video segmentation model with text-prompt-based object tracking
- Updated SAM-3 image segmentation to use the transformers library implementation
- Modified dependencies to use a specific transformers commit for SAM-3 compatibility
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| workers/videos/tasks.py | Registers the new sam-3 task for video processing with GPU queue |
| workers/videos/schemas.py | Adds sam-3 model definition with video-to-video mode support |
| workers/videos/local/sam_3.py | New implementation for SAM-3 video segmentation using transformers library |
| workers/tests/videos/local/test_sam_3_video.py | Adds test cases for SAM-3 video segmentation functionality |
| workers/tests/videos/helpers.py | Registers SAM-3 in test routing and adds segmentation helper functions |
| workers/images/local/sam_3.py | Migrates SAM-3 image processing to transformers library implementation |
| workers/tests/images/local/test_sam_3.py | Updates test prompt format to use comma-separated values |
| workers/requirements.txt | Pins transformers to specific commit and adds kernels dependency |
| clients/openapi.json | Updates API schema to include sam-3 in video models list |
| clients/nuke/gizmos/dd_video.gizmo | Adds sam-3 to the video model dropdown in Nuke integration |
| api/videos/schemas.py | Adds sam-3 model definition to API schemas |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Results are not particularly great atm and are having to use a commit hash from transformers as things are quite active there with the 5.0 release. Going with the transformers implementation as support will be better longer term.