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