sahi
A vision library for performing sliced inference on large images/small objects
Decision gist · record as of 2026-08-14
Yes. SAHI is actively maintained, has no security vulnerabilities, and solves a real problem in object detection on large images. Install it if you work with large images containing small objects or need a framework-agnostic wrapper for detection inference. The low install friction and permissive license make it a low-risk addition to a computer vision project.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a detection framework (ultralytics, mmdet, huggingface, torchvision, or roboflow) to be installed separately; PyTorch and torchvision are also required dependencies not bundled with SAHI.
- Low install friction with a pure-Python wheel and no compiled dependencies.
- Active maintenance with a recent release (11 days ago) and steady repository activity.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions—suitable for most projects.
last release 2026-08-03 (11 days) · last repo commit 2026-08-07 · 5,466 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 281,218 downloads/mo, #8,102 on PyPI
Alternatives
Verify before relying
pip install sahi
from sahi.prediction import get_prediction
from sahi.models.detection import Yolov8DetectionModel
model = Yolov8DetectionModel(model_type="yolov8m", device="cpu")
results = get_prediction(image_path="image.jpg", detection_model=model)- Whether sliced inference provides measurable accuracy gains on your specific object sizes and image resolutions.
- Performance overhead of tiling and merging compared to full-image inference on your hardware.
- Compatibility matrix between SAHI version 0.12.5 and specific detection framework versions.
- Tile dimensions and overlap strategy supported by the slicing API.
What it is and what it does
SAHI is a lightweight wrapper library that enables sliced inference—a technique for improving object detection on large images containing small objects. Instead of running detection on the full image at once, SAHI divides the image into overlapping tiles, runs inference on each tile independently, and merges the predictions back together. This approach helps detection models see small objects at higher effective resolution, which often improves accuracy on objects that would otherwise be missed or poorly localized.
The library integrates with popular detection frameworks (ultralytics, mmdet, huggingface, torchvision, roboflow) and provides both programmatic APIs and command-line tools. It includes utilities for dataset slicing, COCO evaluation, error analysis, and visualization. Runtime dependencies are standard data-processing libraries (numpy, opencv-python, pillow, matplotlib, shapely, requests, pyyaml, click, fire, tqdm), making it straightforward to add to existing computer vision pipelines.
Use it for
- Detect small objects in aerial or satellite imagery by slicing large images into manageable tiles.
- Improve detection accuracy on crowded scenes where objects are densely packed and small relative to image size.
- Preprocess datasets by automatically slicing COCO-annotated images and converting between annotation formats.
- Evaluate detection model performance on large images using built-in COCO evaluation and error analysis tools.
- Prototype detection pipelines with multiple frameworks without rewriting inference code.
- Analyze detection failures across a dataset and export error plots for model debugging.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
SAHI is actively maintained, has no security vulnerabilities, and solves a real problem in object detection on large images. Install it if you work with large images containing small objects or need a framework-agnostic wrapper for detection inference. The low install friction and permissive license make it a low-risk addition to a computer vision project.
Install
sahi on PyPI
Before you install
Low install friction with a pure-Python wheel and no compiled dependencies. Active maintenance with a recent release (11 days ago) and steady repository activity.
Requires a detection framework (ultralytics, mmdet, huggingface, torchvision, or roboflow) to be installed separately; PyTorch and torchvision are also required dependencies not bundled with SAHI.
License in practice
MIT license permits commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
pip install sahi
from sahi.prediction import get_prediction
from sahi.models.detection import Yolov8DetectionModel
model = Yolov8DetectionModel(model_type="yolov8m", device="cpu")
results = get_prediction(image_path="image.jpg", detection_model=model)
Verify before relying
- Whether sliced inference provides measurable accuracy gains on your specific object sizes and image resolutions.
- Performance overhead of tiling and merging compared to full-image inference on your hardware.
- Compatibility matrix between SAHI version 0.12.5 and specific detection framework versions.
- Tile dimensions and overlap strategy supported by the slicing API.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 10 packagesclickfirematplotlibnumpyopencv-pythonpillowpyyamlrequestsshapelytqdm |
| Maintenance | Actively maintained 11 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 281,218 / month, #8,102 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules |
Evidence: sahi-0.12.5-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “sliced inference object detection”
- sahiSAHI performs sliced inference on large images to detect and segment…
- yolov5YOLOv5 is a packaged object detection model that runs inference on…
- inference-cliA command-line tool for running computer vision inference locally via…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also faster-coco-eval · slicer · ultralytics · inference-sdk · inference-cli · mmdet · rfdetr · fiftyone · rcslice · transparent-background