Size Measurement¶
Class: SizeMeasurementBlockV1
Source: inference.core.workflows.core_steps.classical_cv.size_measurement.v1.SizeMeasurementBlockV1
The [Size Measurement Block](https://www.
How This Block Works¶
youtube.com/watch?v=FQY7TSHfZeI) calculates the dimensions of objects relative to a reference object. It uses one model to detect the reference object and another to detect the objects to measure. The block outputs the dimensions of the objects in terms of the reference object.
- Reference Object: This is the known object used as a baseline for measurements. Its dimensions are known and used to scale the measurements of other objects.
- Object to Measure: This is the object whose dimensions are being calculated. The block measures these dimensions relative to the reference object.
Block Usage¶
To use the Size Measurement Block, follow these steps:
- Select Models: Choose a model to detect the reference object and another model to detect the objects you want to measure.
- Configure Inputs: Provide the predictions from both models as inputs to the block.
- Set Reference Dimensions: Specify the known dimensions of the reference object in the format 'width,height' or as a tuple (width, height).
- Run the Block: Execute the block to calculate the dimensions of the detected objects relative to the reference object.
Example¶
Imagine you have a scene with a calibration card and several packages. The calibration card has known dimensions of 5.0 inches by 3.0 inches. You want to measure the dimensions of packages in the scene.
- Reference Object: Calibration card with dimensions 5.0 inches (width) by 3.0 inches (height).
- Objects to Measure: Packages detected in the scene.
The block will use the known dimensions of the calibration card to calculate the dimensions of each package. For example, if a package is detected with a width of 100 pixels and a height of 60 pixels, and the calibration card is detected with a width of 50 pixels and a height of 30 pixels, the block will calculate the package's dimensions as:
- Width: (100 pixels / 50 pixels) * 5.0 inches = 10.0 inches
- Height: (60 pixels / 30 pixels) * 3.0 inches = 6.0 inches
This allows you to obtain the real-world dimensions of the packages based on the reference object's known size.
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/size_measurement@v1to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | โ |
reference_predictions |
List[Any] |
Reference object used to calculate the dimensions of the specified objects. If multiple objects are provided, the highest confidence prediction will be used.. | โ |
reference_dimensions |
Union[List[float], Tuple[float, float], str] |
Dimensions of the reference object in desired units, (e.g. inches). Will be used to convert the pixel dimensions of the other objects to real-world units.. | โ |
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 Size Measurement in version v1.
- inputs:
VLM As Classifier,Line Counter,MoonshotAI Kimi,Path Deviation,Image Stack,Anthropic Claude,Per-Class Confidence Filter,LMM For Classification,Perspective Correction,Clip Comparison,Roboflow Custom Metadata,Detections Merge,Dynamic Zone,Qwen-VL,Email Notification,Object Detection Model,Google Gemma,Email Notification,Twilio SMS/MMS Notification,Template Matching,Model Monitoring Inference Aggregator,OpenRouter,OpenAI,PLC ModbusTCP,VLM As Detector,Florence-2 Model,Motion Detection,OCR Model,OpenAI,Detections Filter,Dimension Collapse,Instance Segmentation Model,Anthropic Claude,YOLO-World Model,Google Gemini,Clip Comparison,Google Gemini,PLC EthernetIP,Buffer,CSV Formatter,Webhook Sink,Byte Tracker,Florence-2 Model,Current Time,Detections List Roll-Up,Mask Edge Snap,OpenAI,Moondream2,VLM As Detector,Google Gemini,Slack Notification,Overlap Filter,Time in Zone,Detections Stabilizer,Local File Sink,Keypoint Detection Model,GLM-OCR,Roboflow Asset Library Attributes,Time in Zone,Google Gemma API,Stitch OCR Detections,Detection Offset,ByteTrack Tracker,Detection Event Log,Detections Transformation,S3 Sink,Microsoft SQL Server Sink,Mask Area Measurement,Google Vision OCR,Twilio SMS Notification,Detections Combine,Size Measurement,Roboflow Vision Events,PTZ Tracking (ONVIF),Bounding Rectangle,SAM2 Video Tracker,Stitch OCR Detections,Event Writer,Qwen3.5-VL,Byte Tracker,Llama 3.2 Vision,Velocity,Byte Tracker,OPC UA Writer Sink,Dynamic Crop,Detections Stitch,Path Deviation,Llama 3.2 Vision,BoT-SORT Tracker,SAM3 Video Tracker,Camera Focus,Segment Anything 2 Model,MoonshotAI Kimi,OpenAI-Compatible LLM,Single-Label Classification Model,CogVLM,Object Detection Model,SAM 3 Interactive,Qwen 3.6 API,Detections Consensus,Multi-Label Classification Model,LMM,SAM 3,OpenAI,Instance Segmentation Model,EasyOCR,Roboflow Visual Search,Roboflow Dataset Upload,SAM 3,Detections Classes Replacement,Instance Segmentation Model,Instance Segmentation Model,SORT Tracker,Roboflow Dataset Upload,PLC Writer,Track Class Lock,Qwen 3.5 API,Object Detection Model,Anthropic Claude,Time in Zone,MQTT Writer,OC-SORT Tracker,SAM 3,Seg Preview - outputs:
Polygon Zone Visualization,VLM As Classifier,Line Counter,MoonshotAI Kimi,Time in Zone,Google Gemma API,Seg Preview,Trace Visualization,Path Deviation,Line Counter Visualization,Anthropic Claude,Color Visualization,LMM For Classification,Perspective Correction,Clip Comparison,Corner Visualization,Halo Visualization,Keypoint Detection Model,Qwen-VL,Email Notification,Size Measurement,Halo Visualization,Object Detection Model,Classification Label Visualization,Google Gemma,Grid Visualization,Mask Visualization,Llama 3.2 Vision,Email Notification,Ellipse Visualization,Reference Path Visualization,Twilio SMS/MMS Notification,Label Visualization,Dot Visualization,Polygon Visualization,Cache Set,Crop Visualization,Path Deviation,Circle Visualization,Llama 3.2 Vision,SAM3 Video Tracker,OpenRouter,OpenAI,VLM As Detector,Florence-2 Model,OpenAI,Motion Detection,MoonshotAI Kimi,Object Detection Model,Instance Segmentation Model,Anthropic Claude,YOLO-World Model,Google Gemini,Qwen 3.6 API,Clip Comparison,Google Gemini,PLC EthernetIP,Detections Consensus,Keypoint Visualization,Buffer,Webhook Sink,Bounding Box Visualization,SAM 3,Florence-2 Model,PLC Reader,Instance Segmentation Model,Detections List Roll-Up,OpenAI,Line Counter,VLM As Detector,Google Gemini,Triangle Visualization,Roboflow Dataset Upload,SAM 3,Time in Zone,Instance Segmentation Model,Detections Classes Replacement,Keypoint Detection Model,Instance Segmentation Model,Roboflow Dataset Upload,Qwen 3.5 API,Object Detection Model,Anthropic Claude,Time in Zone,Keypoint Detection Model,VLM As Classifier,Polygon Visualization,SAM 3,Roboflow Asset Library Attributes
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Size Measurement in version v1 has.
Bindings
-
input
object_predictions(Union[object_detection_prediction,instance_segmentation_prediction]): Model predictions to measure the dimensions of..reference_predictions(Union[object_detection_prediction,list_of_values,instance_segmentation_prediction]): Reference object used to calculate the dimensions of the specified objects. If multiple objects are provided, the highest confidence prediction will be used..reference_dimensions(Union[list_of_values,string]): Dimensions of the reference object in desired units, (e.g. inches). Will be used to convert the pixel dimensions of the other objects to real-world units..
-
output
dimensions(list_of_values): List of values of any type.
Example JSON definition of step Size Measurement in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/size_measurement@v1",
"object_predictions": "$segmentation.object_predictions",
"reference_predictions": "$segmentation.reference_predictions",
"reference_dimensions": [
4.5,
3.0
]
}