🚀 SAHI v0.12.0 Batch Inference, Torch-Free Core & New Open-Vocabulary Models
Sliced Aided Hyper Inference detect the small stuff in big images.
This is one of the largest SAHI releases to date: 95 commits since 0.11.34 (rolling in the 0.11.35/0.11.36 hotfixes), spanning a re-architected post-processing engine, true batch inference, a lighter torch-free core, six new model families, and a full documentation overhaul.
🚀 Highlights
⚡ Batch inference, torch-free core & accelerated post-processing backends (#1336)
A ground-up reworking of how SAHI runs and merges predictions:
- Batch inference slices are now processed in batches end-to-end, dramatically improving throughput on GPU.
- Torch-free core the core slicing/ post-processing path no longer hard-depends on PyTorch. Install only what your model backend needs.
- Pluggable post-processing backends NMS / NMM now run on a selectable backend:
- NumPy zero heavy deps, runs anywhere
- Numba JIT-accelerated CPU path for large slice counts
- TorchVision GPU-accelerated when torch is available
- Backend auto-selects based on what's installed, and can be forced explicitly.
🎚️ Finer control over slicing & post-processing
force_postprocess_typeinget_sliced_predictionfor explicit control over how overlapping detections are merged (#1346).- Per-call
confidence_thresholdoverride across the prediction APIs tune confidence without rebuilding the model object (#1352). - Progress bar + progress callback for
get_sliced_prediction, available in both the Python API and CLI (#1255).
🧠 New model support
- GroundingDINO (HuggingFace) zero-shot, text-prompted open-vocabulary detection. Describe what you're looking for in natural language and run it through SAHI's sliced pipeline perfect for finding small, rare, or unlabeled objects in large images ships with a dedicated demo notebook (#1361).
- Universal segmentation from HuggingFace run any HF universal/panoptic segmentation model through SAHI's sliced pipeline (#1360).
- RF-DETR-Seg segmentation variant of RF-DETR (#1315).
- YOLOE detection model (#1268).
- YOLO-World open-vocabulary detection model (#1267).
- YOLO26 support across the Ultralytics backend, CLI, docs, and notebooks (#1321, #1322, #1356).
📚 Documentation overhaul
- Migrated docs to Zensical with full code typing & formatting cleanup (#1344).
- Chinese (zh) translation of the documentation added and kept in sync (#1253, #1332, #1347).
- New API reference, ** post-processing backends guide**, security policy, and Code of Conduct (#1257, #1336, #1272, #1349).
✨ Performance & Improvements
- Significantly faster post-processing NMS, NMM, and GREEDYNMM now use a shapely
STRtreespatial index, dramatically speeding up merging on images with many slices/detections (#1248). Thanks @nikvo1! - Faster
read_image_as_pilfor quicker slicing throughput (#1353). - Improved performance & resource management in prediction and slicing (#1263).
- Better
nmsperformance with correct handling of empty predictions (#1288). - Replaced
pybboxeswith a lightweight in-houseyolo_bbox_to_voc_bbox(#1320). - Dropped the
pybboxesand pinnedopencv-pythonversion constraints for cleaner installs (#1325).
🐞 Bug Fixes
- Fixed empty bounding boxes caused by an empty
shapely_annotation.multipolygon(#1140). - Fixed invalid segmentation masks for Detectron2 models (#1262).
- Corrected margin calculation in
BoundingBox(#1286). - Fixed CHW-format image handling in
read_image_as_pil(#1287). - Validate overlap ratios in
get_slice_bboxes(must be< 1.0) (#1285). - Corrected error message for invalid model path in
RTDetrDetectionModel(#1266). - Fixed incorrect type annotations in the postprocess module (#1327).
- Ultralytics model now supports additional formats with improved task handling (#1321).
- Added
pywinptyfor Windows dev compatibility (#1319).
🧹 Maintenance & CI
- Pinned all GitHub Actions to commit SHAs for supply-chain security (#1351).
- Multi-OS CI matrix and clearer workflow naming (#1334).
- Bumped to Python 3.12/3.13 in CI and docs (#1259, #1260).
- Removed deprecated YOLOv5 helpers, legacy
requirements.txt, MMDet workflow, and unused Netlify config (#1326, #1342, #1341, #1335). numpy<3.0,torchvision 0.23.0, and many dependency bumps via Dependabot (now also covering pip).
🙏 Contributors
Thanks to everyone who contributed to this release:
@onuralpszr, @fcakyon, @siromermer, @ZephyrKeXiner, @yogendrasinghx, @srikrishnavignesh, @ibuldakov, @ducviet00, @volks73, @RizwanMunawar, @nikvo1, @vinnik-dmitry07, and @gboeer and @dependabot for keeping dependencies fresh.
🌟 New Contributors
- @vinnik-dmitry07 made their first contribution in #1140
- @nikvo1 made their first contribution in #1248
- @volks73 made their first contribution in #1262
- @ZephyrKeXiner made their first contribution in #1253
- @yogendrasinghx made their first contribution in #1326
- @ibuldakov made their first contribution in #1315
- @srikrishnavignesh made their first contribution in #1360
- @siromermer made their first contribution in #1361
Full Changelog: 0.11.34...0.12.0