Open
Conversation
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.
Summary
Adds a second video tracking backend,
sam3cpp_video, powered by PABannier/sam3.cpp — a C++14/ggml engine with no PyTorch dependency. This brings SAM 3 andEdgeTAM to X-AnyLabeling for the first time and gives Apple Silicon / CPU-only users a video-tracking option without installing
torchorsam-2.The existing
segment_anything_2_videobackend is untouched.This is to show some love to the mac people out there.
What's added
New model class
anylabeling/services/auto_labeling/segment_anything_3_video.py— gracefulImportErrorif thesam3cppPython module isn't installed, matching the existing SAM 2 video class'spattern.
5 model entries in the AI model picker (auto-download from HuggingFace on first use):
sam3cpp_video-edgetam-q4_0sam3cpp_video-edgetam-f16sam3cpp_video-sam3_visual-q4_0sam3cpp_video-sam3_visual-f16sam3cpp_video-sam3-q4_0Setup guide at
examples/interactive_video_object_segmentation/sam3cpp/README.md— mirrors the existing SAM 2 example folder structure (uv venv, build sam3.cpp from source, install xlabel).Registry test
tests/test_models/test_auto_labeling_registry.py— asserts no duplicate entries in any_*_MODELSlist.How a user installs it
The interaction model is identical to the existing SAM 2 video tutorial — see the new README for the full walkthrough. In short:
If sam3cpp is not importable, the model picker reports a clean error and the rest of the app keeps working.
Pending upstream work
The sam3cpp Python wrapper (pybind11) is being upstreamed to PABannier/sam3.cpp in a parallel PR. Once that lands, the bindings build collapses to a single CMake flag (-DSAM3_BUILD_PYBIND=ON) and the
README here will be updated. Link to that PR will be added to this description once it's open.
Verification
Thanks for your contribution!
Please confirm that you agree to the Contributor License Agreement (CLA) by checking the box below: