Dynamic Zone¶
Class: DynamicZonesBlockV1
Source: inference.core.workflows.core_steps.transformations.dynamic_zones.v1.DynamicZonesBlockV1
The DynamicZoneBlock is a transformer block designed to simplify polygon
so it's geometrically convex and then reduce number of vertices to requested amount.
This block is best suited when Zone needs to be created based on shape of detected object
(i.e. basketball field, road segment, zebra crossing etc.)
Input detections should be filtered and contain only desired classes of interest.
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/dynamic_zone@v1to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
required_number_of_vertices |
int |
Keep simplifying polygon until number of vertices matches this number. | ✅ |
scale_ratio |
float |
Expand resulting polygon along imaginary line from centroid to edge by this ratio. | ✅ |
apply_least_squares |
bool |
Apply least squares algorithm to fit resulting polygon edges to base contour. | ✅ |
midpoint_fraction |
float |
Fraction of vertices to keep in the middle of each edge before fitting least squares line. This parameter is useful when vertices of convex polygon are not aligned with edge that would be otherwise fitted to points closer to the center of each edge.. | ✅ |
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 Dynamic Zone in version v1.
- inputs:
Template Matching,Line Counter,Line Counter,VLM as Detector,JSON Parser,Path Deviation,Time in Zone,Velocity,Instance Segmentation Model,Model Monitoring Inference Aggregator,Detections Stabilizer,Bounding Rectangle,VLM as Classifier,Local File Sink,Time in Zone,Slack Notification,Seg Preview,Instance Segmentation Model,Image Contours,Clip Comparison,Identify Outliers,Camera Focus,VLM as Detector,Identify Changes,Twilio SMS Notification,Dynamic Zone,Cosine Similarity,VLM as Classifier,Segment Anything 2 Model,Webhook Sink,Dynamic Crop,Detections Consensus,Detections Classes Replacement,Email Notification,Gaze Detection,Detections Combine,Detection Offset,Time in Zone,Detections Filter,Roboflow Custom Metadata,SIFT Comparison,SIFT Comparison,Pixel Color Count,Detections Transformation,Roboflow Dataset Upload,Perspective Correction,Path Deviation,Distance Measurement,PTZ Tracking (ONVIF).md),Roboflow Dataset Upload,Detections Stitch - outputs:
Size Measurement,VLM as Detector,Keypoint Visualization,Byte Tracker,Object Detection Model,Clip Comparison,LMM For Classification,VLM as Classifier,Slack Notification,Seg Preview,Color Visualization,Instance Segmentation Model,Trace Visualization,Polygon Zone Visualization,Halo Visualization,VLM as Classifier,Dynamic Zone,Triangle Visualization,Single-Label Classification Model,Segment Anything 2 Model,Stability AI Inpainting,Reference Path Visualization,Corner Visualization,Detections Classes Replacement,Ellipse Visualization,Gaze Detection,OpenAI,Single-Label Classification Model,Time in Zone,Detection Offset,Roboflow Custom Metadata,Grid Visualization,Cache Set,Line Counter Visualization,YOLO-World Model,OpenAI,Florence-2 Model,Roboflow Dataset Upload,Path Deviation,Label Visualization,PTZ Tracking (ONVIF).md),Model Comparison Visualization,Multi-Label Classification Model,Multi-Label Classification Model,Roboflow Dataset Upload,Template Matching,Line Counter,Line Counter,Path Deviation,Time in Zone,Polygon Visualization,Instance Segmentation Model,Velocity,Model Monitoring Inference Aggregator,Llama 3.2 Vision,Detections Stabilizer,Icon Visualization,Bounding Rectangle,Time in Zone,Blur Visualization,Clip Comparison,VLM as Detector,Object Detection Model,Overlap Filter,Twilio SMS Notification,Bounding Box Visualization,Classification Label Visualization,Background Color Visualization,Webhook Sink,Dynamic Crop,Dot Visualization,Pixelate Visualization,Detections Consensus,Byte Tracker,Email Notification,Buffer,Detections Combine,Crop Visualization,Detections Filter,Keypoint Detection Model,Mask Visualization,Detections Merge,SIFT Comparison,Detections Transformation,Google Gemini,Perspective Correction,Keypoint Detection Model,Distance Measurement,Anthropic Claude,Circle Visualization,Detections Stitch,Florence-2 Model,Byte Tracker
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Dynamic Zone in version v1 has.
Bindings
-
input
predictions(instance_segmentation_prediction): .required_number_of_vertices(integer): Keep simplifying polygon until number of vertices matches this number.scale_ratio(float): Expand resulting polygon along imaginary line from centroid to edge by this ratio.apply_least_squares(boolean): Apply least squares algorithm to fit resulting polygon edges to base contour.midpoint_fraction(float_zero_to_one): Fraction of vertices to keep in the middle of each edge before fitting least squares line. This parameter is useful when vertices of convex polygon are not aligned with edge that would be otherwise fitted to points closer to the center of each edge..
-
output
zones(list_of_values): List of values of any type.predictions(instance_segmentation_prediction): Prediction with detected bounding boxes and segmentation masks in form of sv.Detections(...) object.simplification_converged(boolean): Boolean flag.
Example JSON definition of step Dynamic Zone in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/dynamic_zone@v1",
"predictions": "$segmentation.predictions",
"required_number_of_vertices": 4,
"scale_ratio": 1.05,
"apply_least_squares": true,
"midpoint_fraction": 0.9
}