๐ Summary
SAM/SAM2 get a new feature-based inference path with standardized tensor outputs, smarter prompt scaling, and a cleaner API โ making segmentation faster to integrate and more consistent end-to-end. ๐
๐ Key Changes
- SAM/SAM2: Added inference_features API to run decoding directly from image features (no full image pass required) ๐ง โก
- Unified outputs: masks and scores now return torch.Tensor (instead of numpy) for consistent PyTorch workflows ๐งฑ
- Improved prompt handling: _prepare_prompts now takes src_shape and dst_shape for accurate scaling across pipelines ๐ฏ
- Refactor & cleanup: SAM2 duplicate prompt_inference path removed; shared feature-based logic used for both models ๐งน
- New utilities:
- _inference_features internal helpers for SAM and SAM2
- Public inference_features returning masks and xyxy boxes with scores ๐ฆ
- Docs fixes and enhancements:
- Corrected SAM predictor example labels format ๐
- Added a Comet ML tutorial video for YOLO11 integration ๐ฅ
- Downloader improvements: multi-threaded downloads show progress, clearer logs, and no curl dependency in VOC/VisDrone datasets ๐ฅ
- CI/Infra: actions/checkout updated to v5; SBOM generation made more reliable via a dedicated venv ๐ ๏ธ
๐ฏ Purpose & Impact
- Faster pipelines and easier integration: Feature-level inference lets advanced users cache encoder outputs and run multiple prompt decodes without re-encoding images, reducing latency and compute costs ๐
- More robust, less brittle code: Standardized tensor outputs simplify downstream processing, batching, and device management โ
- Higher accuracy in prompt placement: Explicit source/destination shapes ensure prompts scale correctly, improving segmentation quality across varied image sizes ๐ฏ
- Cleaner APIs for SAM/SAM2: Reduced duplication and consistent methods make it easier to build on top of SAM models and maintain custom workflows ๐งฉ
- Better user experience: Clearer docs and examples reduce errors; improved download feedback and reliability save time and headaches โฑ๏ธ
- Stronger CI and compliance posture: Updated actions and SBOM workflow enhance build reliability and security readiness ๐
What's Changed
- Fix Anchore SBOM action by @glenn-jocher in #21681
- Fix CI.md table by @glenn-jocher in #21683
- Add https://youtu.be/hfSK3Mk5P0I to docs by @RizwanMunawar in #21688
- Fix SAM
Predictor
example in docs by @Laughing-q in #21700 - Progress multi-thread downloads by @glenn-jocher in #21712
- Bump actions/checkout from 4 to 5 in /.github/workflows by @dependabot[bot] in #21717
ultralytics 8.3.180
newinference_features
method for SAM models by @Laughing-q in #21708
Full Changelog: v8.3.179...v8.3.180