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@v2
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 v2
.
- inputs:
Reference Path Visualization
,Identify Outliers
,Blur Visualization
,Pixelate Visualization
,Classification Label Visualization
,Background Color Visualization
,Dynamic Crop
,Keypoint Visualization
,Camera Focus
,Mask Visualization
,Clip Comparison
,Image Slicer
,Absolute Static Crop
,Stability AI Image Generation
,Image Blur
,Distance Measurement
,Identify Changes
,Line Counter
,Circle Visualization
,Grid Visualization
,Crop Visualization
,Image Convert Grayscale
,Image Threshold
,Trace Visualization
,Template Matching
,SIFT Comparison
,Polygon Visualization
,Triangle Visualization
,Stability AI Inpainting
,Detections Consensus
,Halo Visualization
,Dot Visualization
,Polygon Zone Visualization
,Pixel Color Count
,Camera Calibration
,Line Counter
,SIFT
,Corner Visualization
,Image Contours
,Model Comparison Visualization
,Stitch Images
,Bounding Box Visualization
,Line Counter Visualization
,Image Slicer
,Perspective Correction
,Image Preprocessing
,SIFT Comparison
,Label Visualization
,Relative Static Crop
,Color Visualization
,Ellipse Visualization
- outputs:
Multi-Label Classification Model
,Single-Label Classification Model
,Classification Label Visualization
,Background Color Visualization
,Dynamic Crop
,Clip Comparison
,Mask Visualization
,Google Vision OCR
,Buffer
,Segment Anything 2 Model
,Absolute Static Crop
,LMM For Classification
,Florence-2 Model
,Image Blur
,Stability AI Image Generation
,Roboflow Dataset Upload
,CogVLM
,OCR Model
,Circle Visualization
,Clip Comparison
,Crop Visualization
,Template Matching
,VLM as Detector
,Multi-Label Classification Model
,OpenAI
,Detections Stitch
,QR Code Detection
,OpenAI
,Image Preprocessing
,Pixel Color Count
,Detections Stabilizer
,VLM as Classifier
,Time in Zone
,Model Comparison Visualization
,Stitch Images
,Bounding Box Visualization
,Keypoint Detection Model
,Dominant Color
,SIFT Comparison
,Moondream2
,Perspective Correction
,Relative Static Crop
,Color Visualization
,Ellipse Visualization
,Reference Path Visualization
,Blur Visualization
,Anthropic Claude
,Pixelate Visualization
,LMM
,Llama 3.2 Vision
,Instance Segmentation Model
,VLM as Detector
,Keypoint Visualization
,Camera Focus
,Single-Label Classification Model
,Qwen2.5-VL
,Florence-2 Model
,YOLO-World Model
,Barcode Detection
,SmolVLM2
,Trace Visualization
,Image Convert Grayscale
,Image Threshold
,Triangle Visualization
,Polygon Visualization
,Stability AI Inpainting
,Keypoint Detection Model
,Halo Visualization
,Dot Visualization
,Google Gemini
,Polygon Zone Visualization
,CLIP Embedding Model
,Instance Segmentation Model
,VLM as Classifier
,Camera Calibration
,Gaze Detection
,Object Detection Model
,SIFT
,Corner Visualization
,Image Contours
,Roboflow Dataset Upload
,Line Counter Visualization
,Image Slicer
,Image Slicer
,Byte Tracker
,Label Visualization
,Object Detection Model
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@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:
Reference Path Visualization
,Identify Outliers
,Blur Visualization
,Pixelate Visualization
,Classification Label Visualization
,Background Color Visualization
,Dynamic Crop
,Keypoint Visualization
,Camera Focus
,Mask Visualization
,Clip Comparison
,Image Slicer
,Absolute Static Crop
,Stability AI Image Generation
,Image Blur
,Distance Measurement
,Identify Changes
,Line Counter
,Circle Visualization
,Grid Visualization
,Crop Visualization
,Image Convert Grayscale
,Image Threshold
,Trace Visualization
,Template Matching
,SIFT Comparison
,Polygon Visualization
,Triangle Visualization
,Stability AI Inpainting
,Detections Consensus
,Halo Visualization
,Dot Visualization
,Polygon Zone Visualization
,Pixel Color Count
,Camera Calibration
,Line Counter
,SIFT
,Corner Visualization
,Image Contours
,Model Comparison Visualization
,Stitch Images
,Bounding Box Visualization
,Line Counter Visualization
,Image Slicer
,Perspective Correction
,Image Preprocessing
,SIFT Comparison
,Label Visualization
,Relative Static Crop
,Color Visualization
,Ellipse Visualization
- outputs:
Multi-Label Classification Model
,Single-Label Classification Model
,Classification Label Visualization
,Background Color Visualization
,Dynamic Crop
,Clip Comparison
,Mask Visualization
,Google Vision OCR
,Buffer
,Segment Anything 2 Model
,Absolute Static Crop
,LMM For Classification
,Florence-2 Model
,Image Blur
,Stability AI Image Generation
,Roboflow Dataset Upload
,CogVLM
,OCR Model
,Circle Visualization
,Clip Comparison
,Crop Visualization
,Template Matching
,VLM as Detector
,Multi-Label Classification Model
,OpenAI
,Detections Stitch
,QR Code Detection
,OpenAI
,Image Preprocessing
,Pixel Color Count
,Detections Stabilizer
,VLM as Classifier
,Time in Zone
,Model Comparison Visualization
,Stitch Images
,Bounding Box Visualization
,Keypoint Detection Model
,Dominant Color
,SIFT Comparison
,Moondream2
,Perspective Correction
,Relative Static Crop
,Color Visualization
,Ellipse Visualization
,Reference Path Visualization
,Blur Visualization
,Anthropic Claude
,Pixelate Visualization
,LMM
,Llama 3.2 Vision
,Instance Segmentation Model
,VLM as Detector
,Keypoint Visualization
,Camera Focus
,Single-Label Classification Model
,Qwen2.5-VL
,Florence-2 Model
,YOLO-World Model
,Barcode Detection
,SmolVLM2
,Trace Visualization
,Image Convert Grayscale
,Image Threshold
,Triangle Visualization
,Polygon Visualization
,Stability AI Inpainting
,Keypoint Detection Model
,Halo Visualization
,Dot Visualization
,Google Gemini
,Polygon Zone Visualization
,CLIP Embedding Model
,Instance Segmentation Model
,VLM as Classifier
,Camera Calibration
,Gaze Detection
,Object Detection Model
,SIFT
,Corner Visualization
,Image Contours
,Roboflow Dataset Upload
,Line Counter Visualization
,Image Slicer
,Image Slicer
,Byte Tracker
,Label Visualization
,Object Detection Model
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
}