Title: Ultralytics v8.3.182 — Partial Typing, Stronger SAM Reliability, and Easier Mask Plotting
Summary
Ultralytics v8.3.182 marks the package as “partially typed” for improved IDE and type-checker support, and brings robustness and usability upgrades to SAM image sizing and mask plotting. No breaking changes—just smoother workflows and clearer docs.
New Features
- Partial typing support
- The package now includes a py.typed file with a “partial” marker to improve mypy/pyright hints and autocompletion while signaling that typing coverage isn’t yet complete.
- PR: Enable type-checking with py.typed marker by @Y-T-G
`ultralytics 8.3.182` Enable type-checking with `py.typed` marker by Y-T-G · Pull Request #21698 · ultralytics/ultralytics · GitHub
Improvements
- SAM/SAM2 image sizing and reliability
- Predictor image size is now synced with the model, and internal embedding size calculations are updated to follow imgsz changes—reducing shape mismatch issues.
- Flexible imgsz support for SAM2 tracking.
- PR: Support flexible imgsz for SAM2 tracking by @Laughing-q
Support flexible `imgsz` for SAM2 tracking by Laughing-q · Pull Request #21743 · ultralytics/ultralytics · GitHub
- Mask plotting on CPU with NumPy
- Annotator.masks now accepts NumPy masks and can render without a GPU tensor, making CPU-only visualization straightforward.
- PR: Add numpy masks support to Annotator.masks by @Laughing-q
Add `numpy` masks support to `Annotator.masks` method by Laughing-q · Pull Request #21744 · ultralytics/ultralytics · GitHub
- Documentation clarity
- imgsz is documented as int; rect behavior clarified, including how resizing differs between YOLO and RT-DETR for more predictable training.
- PR: Fix argument type for imgsz and update rect description in docs by @Y-T-G
Fix argument type for `imgsz` and update `rect` description in docs by Y-T-G · Pull Request #21737 · ultralytics/ultralytics · GitHub
Bug Fixes
- Stability improvements for SAM-related workflows after imgsz changes, preventing feature map mismatches and smoothing mask/prompt behavior across batches.
Tip
You can now plot masks on CPU without a torch image tensor:
annotator.masks(np_masks, colors, im_gpu=None, alpha=0.5)
Why this matters
- Better developer experience: richer autocompletion, fewer false positives from type-checkers, and a clear “partial typing” signal.
- More robust SAM/SAM2 workflows: fewer shape mismatches after imgsz changes.
- Easier CPU-only visualization: render segmentation masks directly from NumPy arrays.
- Clearer training setup: less confusion around imgsz and rect across YOLO and RT-DETR.
- Safe to upgrade: no core behavioral changes—quality-of-life focused.
Getting started
- Release notes: Release v8.3.182 - `ultralytics 8.3.182` Enable type-checking with `py.typed` marker (#21698) · ultralytics/ultralytics · GitHub
- Full changelog: Comparing v8.3.181...v8.3.182 · ultralytics/ultralytics · GitHub
- Documentation: See the Ultralytics Docs for details: https://docs.ultralytics.com
Call for feedback
Please upgrade to v8.3.182, try the new typing hints, SAM improvements, and CPU mask plotting, and let us know how it goes. Your feedback helps us prioritize what to improve next. Big thanks to our community contributors—this release is powered by you.
Contributors and PRs
- @Y-T-G — Enable type-checking with py.typed, imgsz/rect docs improvements
- @Laughing-q — Flexible imgsz for SAM2 tracking, NumPy masks in Annotator.masks
Version
- v8.3.182