SAHI

Slicing aided inference library that improves small object detection on large images with any detector.

Open SourceSelf HostedOffline Capable
0.0 (0)

About

Small objects get lost when a high resolution image is squeezed down to a detector's input size, and SAHI attacks that problem by slicing the image into overlapping tiles, running inference on each slice, and merging the predictions back into full-image coordinates. The approach, called slicing aided hyper inference, works as a wrapper around existing models rather than a new architecture, with adapters for Ultralytics YOLOv8 through YOLO26, MMDetection, Detectron2, TorchVision, Hugging Face Transformers, RT-DETR, Roboflow RF-DETR, YOLO-World, and YOLOE. The package installs with pip install sahi, adds a CLI for prediction plus COCO dataset utilities such as slicing, subsetting, and error analysis, and integrates with FiftyOne for visual inspection. It runs wherever the underlying detector runs, on CPU or GPU, and is released under the MIT license. The method was published at IEEE ICIP 2022 and is widely used for aerial and satellite imagery, surveillance footage, and other domains where targets occupy a handful of pixels; the repository has passed 5,000 GitHub stars.

Should you use SAHI?

Pick it when

Pick SAHI when objects cover only a few pixels in large frames, such as drone, satellite, or wide-angle surveillance imagery, and you want better small-object recall from a detector you already trained without changing its architecture.

Look elsewhere when

Skip it for latency-bound live video or scenes where objects are already large: running the detector on every overlapping tile multiplies compute per image. For a fixed camera setup, training at a higher input resolution may be simpler.

Alternatives to SAHI

  • Supervision

    Offers slice-based inference inside a broader toolkit with annotators, zones, and tracking; SAHI goes deeper on slicing options and COCO error analysis.

  • Ultralytics YOLO

    Train at a larger input size instead of slicing: one pass per image is faster, but small objects can still vanish when huge frames are downscaled.

  • FiftyOne

    Pairs with SAHI to inspect where small-object detections fail, but it curates and evaluates datasets rather than improving predictions itself.

Reviews (0)

Leave a Review

No reviews yet. Be the first to review!

Details

Price
Free
Platform
Local/Desktop
Difficulty
Easy (2/5)
License
MIT
Added
Jul 29, 2026

Tags