Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Principle:Obss Sahi Full Image Detection

From Leeroopedia


Knowledge Sources
Domains Object_Detection, Computer_Vision, Inference
Last Updated 2026-02-08 12:00 GMT

Overview

A complementary detection pass on the full (unsliced) image that captures large objects which may be fragmented or missed when the image is divided into small slices.

Description

While slicing dramatically improves small object detection, it can negatively affect large objects. An object that spans multiple slices may be partially detected in each slice, producing fragmented predictions. Conversely, objects that are large relative to the slice size may not fit within any single slice properly.

Full-image detection addresses this by running the detector once on the entire image at full resolution. The resulting large-object detections are then combined with the per-slice detections in the merging step. This dual-pass approach (slices + full image) ensures comprehensive detection across all object scales.

In SAHI, full-image detection is conditionally executed within get_sliced_prediction() when perform_standard_pred=True (the default) and the image has been sliced into more than one tile. The full-image pass uses shift_amount=[0, 0] since no coordinate remapping is needed.

Usage

This principle applies automatically within the SAHI sliced inference pipeline. It activates when:

  • The image is large enough to require multiple slices
  • perform_standard_pred is enabled (default behavior)

The full-image detections complement slice detections, and both sets are merged in the prediction merging step. Disable this for speed if you only need small object detection.

Theoretical Basis

The dual-pass strategy can be formalized as:

# Pseudocode for dual-pass detection
all_predictions = []

# Pass 1: Per-slice detection (optimized for small objects)
for slice_img, offset in slices:
    preds = detect(slice_img, shift=offset, full_shape=original_size)
    all_predictions.extend(preds)

# Pass 2: Full-image detection (optimized for large objects)
if perform_standard_pred and num_slices > 1:
    full_preds = detect(full_image, shift=[0,0])
    all_predictions.extend(full_preds)

# Merge to resolve duplicates
final_predictions = merge(all_predictions)

This ensures coverage across the full object size spectrum. The merging step (NMS/NMM) handles duplicates where both the slice pass and full-image pass detect the same object.

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment