SAHI: sliced inference that ships no detection backend of its own
Framework agnostic sliced/tiled inference + interactive ui + error analysis plots
At a glance
- What is it?
- A lightweight Python vision library for running detectors over tiles of a large image, so small objects become findable. Its ten runtime dependencies include opencv, shapely, pillow and tqdm, and no detector at all, which is the framework agnostic part taken literally. Meanwhile the advertised model list is shorter than the notebooks in demo/, and the code quality badge points at a CodeFactor page under another account.
- Who is it for?
- SAHI is a good answer to one specific problem, small objects in large images, and it keeps that problem clean by refusing to own a model runtime. Two things follow from that choice and both need checking.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 21 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 19, 2026, and from our analysis. They are not legal advice.
Star history
- obss/sahi5,608 ★ · +110
| Repository | 2026-09-13 | 2026-11-19 |
|---|---|---|
| obss/sahi | 5.5k | 5.6k |
110 Stars in the last 67 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
pip install sahi gives you slicing and no detector at all
The basic install is one line:
pip install sahiWhat that line pulls in is worth reading closely, because it is the whole design in one file:
dependencies = [
"opencv-python>=4.12.0.88",
"matplotlib",
"shapely>=2.0.0",
"tqdm>=4.48.2",
"pillow>=8.2.0",
"numpy",
"pyyaml",
"fire",
"requests",
"click",
]Ten packages, and not one of them is a detection framework. No torch, no ultralytics, no mmdetection, no transformers. You get an image library, a geometry library for the slice boxes, a progress bar, a plotting library and two CLI frameworks. The description calls this framework agnostic, and the dependency list turns that phrase into a concrete fact: the detector is your problem, and the model family you choose decides what you have to install on top. A working setup therefore has at least two lockfiles to reason about, not one.
The advertised model list is shorter than the notebooks in demo/
The command table summarises predict as working with any ultralytics, mmdet, huggingface or torchvision model. Four families. Now count the notebooks in the demo folder: inference_for_detectron2, inference_for_groundingdino, inference_for_huggingface, inference_for_mmdetection, inference_for_roboflow, inference_for_rtdetr, inference_for_torchvision, inference_for_ultralytics, inference_for_ultralytics_yoloe, inference_for_yolov5, plus inference_with_batch_slicing and slicing.
So Detectron2, Grounding DINO, RT-DETR, YOLOv5, YOLOE and roboflow all have worked examples in the repository, and none of them appears in the sentence that summarises the command. Two demos are also about slicing mechanics rather than any backend at all.
That gap is not a contradiction, since the table is a summary and the notebooks are the detail, but it is the kind of gap that costs an afternoon. A reader choosing a backend for a job, say a vision language grounding model or a two stage detector, would reasonably conclude from the table that neither is supported.
Two command line frameworks are pinned for one console script
The dependency list carries both fire and click, two libraries that solve the same problem and are not usually combined. The packaging metadata then declares exactly one entry point:
[project.scripts]
sahi = "sahi.cli:app"One console script named sahi, pointing at a single app object, with two CLI libraries available to it. At least one of them is presumably doing the argument dispatch and the other is inherited from a dependency chain rather than chosen, or one serves the internal entry and the other the public one. The metadata does not say which, and nothing in the repository records the decision.
The seven commands in the documentation table, predict, predict-fiftyone, coco slice, coco fiftyone, coco evaluate, coco analyse and coco yolo, all hang off that single app. So the surface a user touches is one command with seven subcommands. Both are listed as hard runtime dependencies rather than extras, which is the part that would be worth pruning.
The code quality badge points at a fork under a different account
The badge row at the top of the readme mixes links that belong to this repository with one that does not. The licence and CI links resolve under obss/sahi. The code quality badge resolves to codefactor.io/repository/github/onuralpszr/sahi, and onuralpszr is a maintainer listed in the packaging metadata, not the owner of the repository this readme belongs to.
It is a small error, and the kind that survives because a badge image is invisible once it renders. Nothing about it is dangerous. What it does do is make the readme a slightly unreliable index: a reader who follows that badge is measuring a different codebase, and one who is not sure whether the fork is ahead or behind has no way to tell from the page.
It is worth mentioning precisely because the rest of the badge row is careful, with per download counts, a conda-forge channel, a Snyk link and a paper link. One stale href in an otherwise accurate header is the whole of the problem.
The Changelog URL points at releases while CHANGELOG.md sits in the root
The packaging metadata gives five project URLs. Three are ordinary: the repository homepage, the source, and a documentation link into the main branch docs directory. Two are more revealing.
The Changelog entry points at the GitHub releases page rather than at a file, even though a CHANGELOG.md is present in the repository root. So the file and the link are two different records of the same history, and only one of them is what a user is sent to. The bug reports link is the other: routing reports through a question and answer discussion category means issues are triaged as conversations rather than tracked in the issue tracker.
Neither is unusual and neither is harmful. The combination does tell you something about how the project is run, though. Change history and support questions both resolve to human conversation rather than to a versioned file, which suits a small maintainer team and makes a support history harder to search later.
Half the runtime dependencies carry no version floor at all
Of the ten runtime dependencies, four have a floor and six have none. The floors are opencv-python>=4.12.0.88, shapely>=2.0.0, tqdm>=4.48.2 and pillow>=8.2.0. The bare six are matplotlib, numpy, pyyaml, fire, requests and click. There is also no upper bound anywhere in the list, so a resolver is free to take a new major of any of them.
That places reproducibility in the hands of whoever consumes the library. A frozen requirements file or a lock in your own project is what pins numpy here, not the library's metadata. For a library whose entire job is numerical work on image arrays, that is the difference between a reproducible detection run and a mystery.
The version line deserves the same attention. The current release is 0.14.0, published on 2026-11-01, matching the version field in the packaging metadata, and 0.13.0 and 0.13.1 landed on 2026-10-31. Three releases in two days, and still a 0.x number, which conventionally allows breaking changes in any of them.
Three README languages, three documentation build configs
The language switch offers English, 简体中文 and Türkçe, pointing at docs/zh/README.md and docs/tr/README.md beside the root readme. The same three languages appear again in the documentation build configuration, where zensical.toml sits next to zensical.tr.toml and zensical.zh.toml. So the translations are first class in the build rather than added afterwards.
The rest of the tooling is a similar mix. A pre-commit config and a .rumdl.toml for markdown linting sit next to a .prettierrc.yaml, which is the JavaScript and TypeScript formatter, in a repository whose own code is Python. That is a small inconsistency, and it is the kind that comes from docs and notebooks being maintained by people who work across both languages.
The repository root also carries a CITATION.cff, which is the machine readable citation file, alongside SECURITY.md, CODE_OF_CONDUCT.md and CONTRIBUTING.md. The project publishes the administrative files that let outsiders report, cite and contribute properly, which is worth more than the badge row it sits next to.
Two audiences are approved by assertion rather than by measurement
The readme has two approval sections. The community one points at a Google Scholar list of publications citing SAHI, currently stated as 600 or more, and at a discussion thread listing competition winners that used it. Both are links a reader can open and count, which makes them checkable claims.
The second section, headed Approved by AI Tools, makes a different kind of claim. It says the documentation is indexed in Context7 MCP, providing AI coding assistants with up to date, version specific code examples and API references, and points at an llms.txt file hosted for that purpose plus a Context7 installation guide. The repository root carries a context7.json, so at least the registration is visible in the tree.
Neither section is a guarantee and neither claims to be. What is worth noticing is that the second one is maintained by the project itself while the first is a public index, and that the useful part of the second is the version specific claim. That is the part to test on your own model of choice before you trust a snippet, because a documentation surface built for machine readers fails differently when it goes stale than prose does.
Editorial conclusion
SAHI is a good answer to one specific problem, small objects in large images, and it keeps that problem clean by refusing to own a model runtime. Two things follow from that choice and both need checking. First, your environment supplies the detector, so pinning SAHI alone tells you nothing about which weights will run or against which framework version. Second, the documentation table is not the coverage map: the demo folder carries notebooks for backends the summary sentence leaves out, so read the notebooks rather than the table when you are choosing a backend. Treat the version line as pre-1.0 and lock it yourself, since a 0.x number carries no compatibility promise and six of the ten runtime dependencies are unpinned. It is a well maintained project with an unusually honest dependency list, and that combination is worth more to a team than a bundled model would have been.
Frequently asked questions
What is Sahi in object detection?
Sahi is a lightweight Python vision library for sliced inference, the practice of cutting a large image into tiles so detectors can find small objects that a single pass would miss. It is framework agnostic and supports large scale object detection and instance segmentation through easy to use APIs.
What does pip install sahi actually give me?
Ten runtime dependencies and no detector. They are opencv-python, matplotlib, shapely, tqdm, pillow, numpy, pyyaml, fire, requests and click, so the detection framework such as ultralytics, mmdetection or torchvision has to be installed separately.
Which models can sahi run, and is the list in the readme complete?
The readme summary names ultralytics, mmdet, huggingface and torchvision, while the demo folder also carries notebooks for Detectron2, Grounding DINO, RT-DETR, YOLOv5, YOLOE and roboflow, so the summary is narrower than the examples in the repository.
What Python versions and current release does sahi support?
The packaging metadata sets requires-python to 3.10 or higher and the classifiers list Python 3.10 through 3.15. The current release is 0.14.0 from 2026-11-01, which matches the version field in the metadata.
Does sahi ship its own AI readable documentation?
It points at an llms.txt hosted for Context7 and says the documentation is indexed there with version specific code examples and API references for AI coding assistants. The repository root also carries a context7.json, and the installation guide for that service is linked.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/obss-sahi)Star history chart for your README
[](https://hysenlabs.com/projects/obss-sahi)Was this useful?