Title: Ultralytics v8.3.187 – SAM 2 interactive few‑shot segment-and-track + faster data with Polars
Summary
Ultralytics v8.3.187 introduces training-free, interactive few-shot segmentation and tracking for SAM 2 via a new SAM2DynamicInteractivePredictor, and migrates core data operations from Pandas to Polars for faster, lighter analytics. Plus, better plots, clearer docs, and UX refinements.
What’s new in v8.3.187
- SAM 2 dynamic interactive segmentation/tracking
- New SAM2DynamicInteractivePredictor for few-shot, multi-object segment-and-track across images or video-like sequences.
- Prompt with boxes, points, or masks; maintain per-object IDs with real-time memory updates.
- Continual refinement over time—no retraining required.
- Fully integrated with existing SAM 2 models and documented with examples and API reference.
- Faster, lighter data workflows with Polars
- Core data ops now use Polars for training, validation, benchmarking, plotting, and logging.
- to_df() returns a Polars DataFrame; CSV/JSON I/O via Polars.
- Removed legacy export helpers: XML, HTML, SQL.
- Smaller dependency footprint and faster exports/plots.
- Visualization and UX
- labels.jpg now shows instance counts on class bars for small-class datasets.
- plot_tune_results() gains consistent Matplotlib styling via @plt_settings() for both headless and notebook runs.
- README/docs banners updated for YOLOvision with correct sizing and tracking.
- Docs improvements
- SAM 2 dynamic interactive guide with examples and API.
- OBB task clarification: YOLO11 OBB angles must be in [0, 90).
- MobileSAM comparison corrected: “7× smaller, 5× faster” than FastSAM.
- More reliable docs builds with mkdocs-ultralytics-plugin>=0.1.29.
Purpose and impact
- Interactive few-shot segmentation/tracking
- Purpose: Add/track multiple objects over time, refine them interactively, and share memory across frames or independent images—no additional training required.
- Impact: Faster video annotation, interactive editing, surveillance, medical/time-series workflows, and semi-automatic dataset labeling with improved consistency.
- Minimal example:
from ultralytics.models.sam import SAM2DynamicInteractivePredictor overrides = dict(model="sam2_t.pt", task="segment", mode="predict", imgsz=1024, conf=0.01, save=False) predictor = SAM2DynamicInteractivePredictor(overrides=overrides, max_obj_num=10) # Add an object with a box prompt and store in 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") # Add another object later predictor.inference(img="image3.jpg", bboxes=[[300, 300, 400, 400]], obj_ids=[2], update_memory=True) # Continue inference results = predictor(source="image4.jpg")
- Polars data layer
- Purpose: Speed up and simplify data operations across the stack.
- Impact: Faster exports and plotting, fewer dependencies. Note: code expecting Pandas from to_df() should adapt to Polars (e.g., df.to_pandas() if needed). XML/HTML/SQL export helpers removed—use CSV/JSON or Polars I/O.
New Features
- SAM2DynamicInteractivePredictor for interactive few-shot segmentation and tracking
- PR: ultralytics/ultralytics#21232 by @ShuaiLYU
Improvements
- Core data ops refactor to Polars (training, benchmarks, plotting, W&B)
- PR: ultralytics/ultralytics#21619 by @Laughing-q
- Matplotlib styling for plot_tune_results() via @plt_settings() for agg backend
- PR: ultralytics/ultralytics#21818 by @onuralpszr
- labels.jpg shows per-class instance counts
- PR: ultralytics/ultralytics#21784 by @darouwan
- README/docs banners updated for YOLOvision event
- PR: ultralytics/ultralytics#21816 by @RizwanMunawar
- Docs build reliability with mkdocs-ultralytics-plugin>=0.1.29
- PR: ultralytics/ultralytics#21811 by @glenn-jocher
Documentation
- OBB angle clarification: YOLO11 OBB angles must be in [0, 90)
- PR: ultralytics/ultralytics#21815 by @Y-T-G
- MobileSAM comparison corrected (“7× smaller, 5× faster” than FastSAM)
- PR: ultralytics/ultralytics#21825 by @RizwanMunawar
Bug Fixes
- No user-facing bug fixes in this patch; focus was on new features, refactors, and docs/UX polishing.
New Contributors
- @ShuaiLYU made their first contribution in ultralytics/ultralytics#21232 — welcome!
Getting started
- Upgrade:
pip install -U ultralytics - Try SAM 2 dynamic interactive segmentation/tracking using the example above or see the SAM 2 docs page for more.
Useful links
- Read the SAM 2 dynamic interactive docs with examples
- See the Polars refactor PR
- Learn about the OBB angle clarification
- Check the labels.jpg improvement PR
- Follow the YOLOvision event updates
- Full Changelog: compare v8.3.186…v8.3.187
- Release notes: v8.3.187
We’d love your feedback
Give the new features a spin in v8.3.187 and let us know how they work for your workflows. Share your experience, edge cases, or suggestions in Discussions—your input helps the YOLO community and Ultralytics team keep improving.