Sahi
Framework agnostic sliced/tiled inference + interactive ui + error analysis plots
Install / Use
/learn @obss/SahiREADME
<div align="center">Overview</div>
SAHI helps developers overcome real-world challenges in object detection by enabling sliced inference for detecting small objects in large images. It supports various popular detection models and provides easy-to-use APIs.
<div align="center"> </div>| Command | Description | |---|---| | predict | perform sliced/standard video/image prediction using any ultralytics/mmdet/huggingface/torchvision model - see CLI guide | | predict-fiftyone | perform sliced/standard prediction using any supported model and explore results in fiftyone app - learn more | | coco slice | automatically slice COCO annotation and image files - see slicing utilities | | coco fiftyone | explore multiple prediction results on your COCO dataset with fiftyone ui ordered by number of misdetections | | coco evaluate | evaluate classwise COCO AP and AR for given predictions and ground truth - check COCO utilities | | coco analyse | calculate and export many error analysis plots - see the complete guide | | coco yolo | automatically convert any COCO dataset to ultralytics format |
Approved by the Community
📜 List of publications that cite SAHI (currently 600+)
🏆 List of competition winners that used SAHI
Approved by AI Tools
SAHI's documentation is indexed in Context7 MCP, providing AI coding assistants with up-to-date, version-specific code examples and API references. We also provide an llms.txt file following the emerging standard for AI-readable documentation. To integrate SAHI docs with your AI development workflow, check out the Context7 MCP installation guide.
<div align="center">Installation</div>
Basic Installation
pip install sahi
<details closed>
<summary>
<big><b>Detailed Installation (Click to open)</b></big>
</summary>
- Install your desired version of pytorch and torchvision:
pip install torch==2.7.0 torchvision==0.22.0 --index-url https://download.pytorch.org/whl/cu126
(torch 2.1.2 is required for mmdet support):
pip install torch==2.1.2 torchvision==0.16.2 --index-url https://download.pytorch.org/whl/cu121
- Install your desired detection framework (ultralytics):
pip install ultralytics>=8.3.161
- Install your desired detection framework (huggingface):
pip install transformers>=4.49.0 timm
- Install your desired detection framework (yolov5):
pip install yolov5==7.0.14 sahi==0.11.21
- Install your desired detection framework (mmdet):
pip install mim
mim install mmdet==3.3.0
- Install your desired detection framework (roboflow):
pip install inference>=0.50.3 rfdetr>=1.1.0
</details>
<div align="center">Quick Start</div>
Tutorials
-
Introduction to SAHI - explore the complete documentation for advanced usage
-
Official paper (ICIP 2022 oral)
-
2025 Video Tutorial (RECOMMENDED)
-
'VIDEO TUTORIAL: Slicing Aided Hyper Inference for Small Object Detection - SAHI'
-
Error analysis plots & evaluation (RECOMMENDED)
-
Interactive result visualization and inspection (RECOMMENDED)
-
YOLOX+SAHIdemo: <a href="https://huggingface.co/spaces/fcakyon/sahi-yolox"><img src="https://raw.githubusercontent.com/obss/sahi/main/resources/hf_spaces_badge.svg" alt="sahi-yolox"></a> -
YOLO12+SAHIwalkthrough: <a href="https://colab.research.google.com/github/obss/sahi/blob/main/demo/inference_for_ultralytics.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="sahi-yolo12"></a> -
YOLO11-OBB+SAHIwalkthrough: <a href="https://colab.research.google.com/github/obss/sahi/blob/main/demo/inference_for_ult
Related Skills
openai-image-gen
329.0kBatch-generate images via OpenAI Images API. Random prompt sampler + `index.html` gallery.
claude-opus-4-5-migration
81.1kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
model-usage
329.0kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
TrendRadar
49.5k⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。
