ultralytics 8.3.187 SAM2: Add SAM2DynamicInteractivePredictor support few-shot inference#21232
Conversation
|
All Contributors have signed the CLA. ✅ |
|
👋 Hello @ShuaiLYU, thank you for submitting an
For further details, you can refer to our Contributing Guide. If your PR addresses a bug and you haven't already, please provide a minimum reproducible example (MRE) so we can verify the fix. This is an automated response 🛠️—an Ultralytics engineer will review your contribution and assist you soon. Thank you for helping improve Ultralytics! 🚀✨ |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
1907b82 to
d6f8b56
Compare
I have read the CLA Document and I sign the CLA |
89f69d7 to
df2f278
Compare
|
I have read the CLA Document and I sign the CLA |
d05205e to
9a87e7e
Compare
d565a29 to
3d8f554
Compare
…eractivePredictor
…iLYU/ultralytics into add_SAM2DynamicInteractivePredictor
5b5444f to
1cb488c
Compare
b142c20 to
68aa0d2
Compare
SAM2DynamicInteractivePredictor support few-shot inference
SAM2DynamicInteractivePredictor support few-shot inferenceultralytics 8.3.187 SAM2: Add SAM2DynamicInteractivePredictor support few-shot inference
|
Absolutely thrilled to see this merged — huge thanks @ShuaiLYU, @Laughing-q, and @glenn-jocher! “Great things are done by a series of small things brought together.” — Vincent van Gogh. Your collective effort delivers a training-free, dynamic SAM 2 experience that makes interactive segmentation and cross-image tracking faster, cleaner, and more intuitive for real-world annotation, editing, and surveillance workflows. Quick start: from ultralytics.models.sam import SAM2DynamicInteractivePredictor
overrides = dict(model="sam2_t.pt", imgsz=1024, task="segment", mode="predict", conf=0.01)
predictor = SAM2DynamicInteractivePredictor(overrides=overrides, max_obj_num=10)
# Add an object via box prompt and update memory
predictor.inference(img="image1.jpg", bboxes=[[100, 100, 200, 200]], obj_ids=[1], update_memory=True)
# Track it in a new image
results = predictor(source="image2.jpg")See the Ultralytics Docs for details: https://docs.ultralytics.com Brilliant work pushing the boundaries of dynamic, interactive segmentation — this will be a game-changer for our users. 🚀 |
|
@glenn-jocher too fast haha I just found a typo EDIT: fixed in https://github.com/ultralytics/ultralytics/pull/21835/files |
I have read the CLA Document and I sign the CLA
Add SAM2DynamicInteractivePredictor for Dynamic Memory-based Segmentation
📋 Description
This PR introduces
SAM2DynamicInteractivePredictor, a new interactive predictor that extends pre-trained SAM2 capabilities with dynamic memory management for multi-object segmentation tasks.✨ Key Features
🔧 Changes Made
SAM2DynamicInteractivePredictorclass inultralytics.models.samApplication Scenarios:
n more suitable for advanced annotation and video analysis tasks!**
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Adds a new training-free SAM 2 mode for dynamic, interactive segmentation and tracking across images/videos, plus related fixes and docs updates. 🚀
📊 Key Changes
🎯 Purpose & Impact
Quick start:
See the Ultralytics Docs for details.