Image Slicer¶
v2¶
Class: ImageSlicerBlockV2 (there are multiple versions of this block)
Source: inference.core.workflows.core_steps.transformations.image_slicer.v2.ImageSlicerBlockV2
Warning: This block has multiple versions. Please refer to the specific version for details. You can learn more about how versions work here: Versioning
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.
Changes compared to v1¶
-
All crops generated by slicer will be of equal size
-
No duplicated crops will be created
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/image_slicer@v2to 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 v2.
- inputs:
Dot Visualization,Line Counter,Stability AI Inpainting,Reference Path Visualization,Clip Comparison,SIFT,Halo Visualization,Image Convert Grayscale,Stability AI Outpainting,Distance Measurement,QR Code Generator,Triangle Visualization,Depth Estimation,Image Contours,Line Counter Visualization,Mask Visualization,Image Slicer,Ellipse Visualization,Model Comparison Visualization,Template Matching,Identify Outliers,Polygon Visualization,Background Color Visualization,Polygon Zone Visualization,Corner Visualization,Crop Visualization,Stitch Images,Contrast Equalization,Blur Visualization,Dynamic Crop,Image Slicer,Camera Focus,Color Visualization,Classification Label Visualization,Label Visualization,Circle Visualization,Image Threshold,SIFT Comparison,Keypoint Visualization,Camera Calibration,Trace Visualization,SIFT Comparison,Image Preprocessing,Morphological Transformation,Identify Changes,Detections Consensus,Icon Visualization,Perspective Correction,Bounding Box Visualization,Absolute Static Crop,Grid Visualization,Pixelate Visualization,Image Blur,Relative Static Crop,Line Counter,Stability AI Image Generation,Pixel Color Count - outputs:
Barcode Detection,Dot Visualization,Stability AI Inpainting,Reference Path Visualization,VLM as Classifier,CLIP Embedding Model,Object Detection Model,VLM as Classifier,Stability AI Outpainting,Perception Encoder Embedding Model,Multi-Label Classification Model,Line Counter Visualization,Ellipse Visualization,Polygon Zone Visualization,Background Color Visualization,Roboflow Dataset Upload,Contrast Equalization,EasyOCR,Object Detection Model,Image Slicer,Qwen2.5-VL,Google Gemini,Byte Tracker,Florence-2 Model,Gaze Detection,Google Vision OCR,Image Threshold,SIFT Comparison,Image Preprocessing,Icon Visualization,OCR Model,YOLO-World Model,Roboflow Dataset Upload,Clip Comparison,Absolute Static Crop,Pixelate Visualization,Buffer,Image Blur,Relative Static Crop,Perspective Correction,Florence-2 Model,Pixel Color Count,VLM as Detector,Single-Label Classification Model,LMM For Classification,Llama 3.2 Vision,Detections Stitch,LMM,Clip Comparison,SIFT,Multi-Label Classification Model,Halo Visualization,SmolVLM2,Image Convert Grayscale,Anthropic Claude,Triangle Visualization,Mask Visualization,Depth Estimation,Keypoint Detection Model,Image Contours,Image Slicer,CogVLM,Model Comparison Visualization,Template Matching,Time in Zone,QR Code Detection,Single-Label Classification Model,Moondream2,Polygon Visualization,Corner Visualization,Crop Visualization,Stitch Images,Blur Visualization,Keypoint Detection Model,Dynamic Crop,Detections Stabilizer,Instance Segmentation Model,OpenAI,Segment Anything 2 Model,Camera Focus,VLM as Detector,Color Visualization,Classification Label Visualization,Label Visualization,OpenAI,Circle Visualization,Keypoint Visualization,Trace Visualization,Camera Calibration,Instance Segmentation Model,Morphological Transformation,OpenAI,Bounding Box Visualization,Dominant Color,Seg Preview,Stability AI Image Generation
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Image Slicer in version v2 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 v2
{
"name": "<your_step_name_here>",
"type": "roboflow_core/image_slicer@v2",
"image": "$inputs.image",
"slice_width": 320,
"slice_height": 320,
"overlap_ratio_width": 0.2,
"overlap_ratio_height": 0.2
}
v1¶
Class: ImageSlicerBlockV1 (there are multiple versions of this block)
Source: inference.core.workflows.core_steps.transformations.image_slicer.v1.ImageSlicerBlockV1
Warning: This block has multiple versions. Please refer to the specific version for details. You can learn more about how versions work here: Versioning
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@v1to 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:
Dot Visualization,Line Counter,Stability AI Inpainting,Reference Path Visualization,Clip Comparison,SIFT,Halo Visualization,Image Convert Grayscale,Stability AI Outpainting,Distance Measurement,QR Code Generator,Triangle Visualization,Depth Estimation,Image Contours,Line Counter Visualization,Mask Visualization,Image Slicer,Ellipse Visualization,Model Comparison Visualization,Template Matching,Identify Outliers,Polygon Visualization,Background Color Visualization,Polygon Zone Visualization,Corner Visualization,Crop Visualization,Stitch Images,Contrast Equalization,Blur Visualization,Dynamic Crop,Image Slicer,Camera Focus,Color Visualization,Classification Label Visualization,Label Visualization,Circle Visualization,Image Threshold,SIFT Comparison,Keypoint Visualization,Camera Calibration,Trace Visualization,SIFT Comparison,Image Preprocessing,Morphological Transformation,Identify Changes,Detections Consensus,Icon Visualization,Perspective Correction,Bounding Box Visualization,Absolute Static Crop,Grid Visualization,Pixelate Visualization,Image Blur,Relative Static Crop,Line Counter,Stability AI Image Generation,Pixel Color Count - outputs:
Barcode Detection,Dot Visualization,Stability AI Inpainting,Reference Path Visualization,VLM as Classifier,CLIP Embedding Model,Object Detection Model,VLM as Classifier,Stability AI Outpainting,Perception Encoder Embedding Model,Multi-Label Classification Model,Line Counter Visualization,Ellipse Visualization,Polygon Zone Visualization,Background Color Visualization,Roboflow Dataset Upload,Contrast Equalization,EasyOCR,Object Detection Model,Image Slicer,Qwen2.5-VL,Google Gemini,Byte Tracker,Florence-2 Model,Gaze Detection,Google Vision OCR,Image Threshold,SIFT Comparison,Image Preprocessing,Icon Visualization,OCR Model,YOLO-World Model,Roboflow Dataset Upload,Clip Comparison,Absolute Static Crop,Pixelate Visualization,Buffer,Image Blur,Relative Static Crop,Perspective Correction,Florence-2 Model,Pixel Color Count,VLM as Detector,Single-Label Classification Model,LMM For Classification,Llama 3.2 Vision,Detections Stitch,LMM,Clip Comparison,SIFT,Multi-Label Classification Model,Halo Visualization,SmolVLM2,Image Convert Grayscale,Anthropic Claude,Triangle Visualization,Mask Visualization,Depth Estimation,Keypoint Detection Model,Image Contours,Image Slicer,CogVLM,Model Comparison Visualization,Template Matching,Time in Zone,QR Code Detection,Single-Label Classification Model,Moondream2,Polygon Visualization,Corner Visualization,Crop Visualization,Stitch Images,Blur Visualization,Keypoint Detection Model,Dynamic Crop,Detections Stabilizer,Instance Segmentation Model,OpenAI,Segment Anything 2 Model,Camera Focus,VLM as Detector,Color Visualization,Classification Label Visualization,Label Visualization,OpenAI,Circle Visualization,Keypoint Visualization,Trace Visualization,Camera Calibration,Instance Segmentation Model,Morphological Transformation,OpenAI,Bounding Box Visualization,Dominant Color,Seg Preview,Stability AI Image Generation
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
}