Image Slicer¶
Class: ImageSlicerBlockV1
Source: inference.core.workflows.core_steps.transformations.image_slicer.v1.ImageSlicerBlockV1
This block enables Slicing Adaptive Inference (SAHI) technique in Workflows providing implementation for first step of procedure - making slices out of input image.
To use the block effectively, it must be paired with detection model (object-detection or instance segmentation) running against output images from this block. At the end - Detections Stitch block must be applied on top of predictions to merge them as if the prediction was made against input image, not its slices.
We recommend adjusting the size of slices to match the model's input size and the scale of objects in the dataset the model was trained on. Models generally perform best on data that is similar to what they encountered during training. The default size of slices is 640, but this might not be optimal if the model's input size is 320, as each slice would be downsized by a factor of two during inference. Similarly, if the model's input size is 1280, each slice will be artificially up-scaled. The best setup should be determined experimentally based on the specific data and model you are using.
To learn more about SAHI please visit Roboflow blog which describes the technique in details, yet not in context of Roboflow workflows.
Type identifier¶
Use the following identifier in step "type"
field: roboflow_core/image_slicer@v1
to add the block as
as step in your workflow.
Properties¶
Name | Type | Description | Refs |
---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
slice_width |
int |
Width of each slice, in pixels. | ✅ |
slice_height |
int |
Height of each slice, in pixels. | ✅ |
overlap_ratio_width |
float |
Overlap ratio between consecutive slices in the width dimension. | ✅ |
overlap_ratio_height |
float |
Overlap ratio between consecutive slices in the height dimension. | ✅ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow
runtime. See Bindings for more info.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to Image Slicer
in version v1
.
- inputs:
Stitch Images
,Pixelate Visualization
,SIFT Comparison
,Line Counter
,Corner Visualization
,Blur Visualization
,Mask Visualization
,Perspective Correction
,SIFT
,Line Counter
,Polygon Zone Visualization
,Polygon Visualization
,Halo Visualization
,Grid Visualization
,Image Slicer
,Model Comparison Visualization
,Trace Visualization
,Camera Focus
,Detections Consensus
,Image Threshold
,Keypoint Visualization
,Crop Visualization
,Template Matching
,Image Preprocessing
,Clip Comparison
,Identify Changes
,SIFT Comparison
,Image Blur
,Relative Static Crop
,Circle Visualization
,Image Convert Grayscale
,Dot Visualization
,Background Color Visualization
,Bounding Box Visualization
,Ellipse Visualization
,Image Contours
,Label Visualization
,Classification Label Visualization
,Line Counter Visualization
,Identify Outliers
,Stability AI Inpainting
,Reference Path Visualization
,Dynamic Crop
,Color Visualization
,Triangle Visualization
,Pixel Color Count
,Absolute Static Crop
,Distance Measurement
- outputs:
Multi-Label Classification Model
,Pixelate Visualization
,Stitch Images
,LMM For Classification
,Keypoint Detection Model
,Gaze Detection
,Instance Segmentation Model
,CLIP Embedding Model
,Blur Visualization
,OCR Model
,Mask Visualization
,Object Detection Model
,Single-Label Classification Model
,SIFT
,YOLO-World Model
,Polygon Visualization
,Halo Visualization
,VLM as Detector
,Google Vision OCR
,Model Comparison Visualization
,Camera Focus
,CogVLM
,Byte Tracker
,Image Threshold
,Keypoint Visualization
,Template Matching
,Image Preprocessing
,Roboflow Dataset Upload
,Relative Static Crop
,Background Color Visualization
,Clip Comparison
,Bounding Box Visualization
,Image Contours
,Label Visualization
,Line Counter Visualization
,Classification Label Visualization
,Ellipse Visualization
,LMM
,Reference Path Visualization
,Stability AI Inpainting
,VLM as Detector
,Dynamic Crop
,Dominant Color
,Triangle Visualization
,Absolute Static Crop
,Object Detection Model
,Florence-2 Model
,Detections Stitch
,Barcode Detection
,SIFT Comparison
,Keypoint Detection Model
,Corner Visualization
,Perspective Correction
,Polygon Zone Visualization
,VLM as Classifier
,Image Slicer
,Trace Visualization
,OpenAI
,Crop Visualization
,Instance Segmentation Model
,Buffer
,Roboflow Dataset Upload
,Clip Comparison
,VLM as Classifier
,Anthropic Claude
,Image Blur
,Dot Visualization
,Image Convert Grayscale
,Circle Visualization
,Google Gemini
,QR Code Detection
,Segment Anything 2 Model
,Single-Label Classification Model
,Florence-2 Model
,Time in Zone
,Detections Stabilizer
,OpenAI
,Color Visualization
,Pixel Color Count
,Multi-Label Classification Model
,Llama 3.2 Vision
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Image Slicer
in version v1
has.
Bindings
-
input
image
(image
): The input image for this step..slice_width
(integer
): Width of each slice, in pixels.slice_height
(integer
): Height of each slice, in pixels.overlap_ratio_width
(float_zero_to_one
): Overlap ratio between consecutive slices in the width dimension.overlap_ratio_height
(float_zero_to_one
): Overlap ratio between consecutive slices in the height dimension.
-
output
slices
(image
): Image in workflows.
Example JSON definition of step Image Slicer
in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/image_slicer@v1",
"image": "$inputs.image",
"slice_width": 320,
"slice_height": 320,
"overlap_ratio_width": 0.2,
"overlap_ratio_height": 0.2
}