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:
Template Matching,Detections Transformation,OpenAI,YOLO-World Model,Detections Classes Replacement,Anthropic Claude,Track Class Lock,Instance Segmentation Model,Mask Edge Snap,Size Measurement,Florence-2 Model,Florence-2 Model,Qwen-VL,Llama 3.2 Vision,Keypoint Detection Model,Velocity,CSV Formatter,LMM,OC-SORT Tracker,Qwen 3.5 API,Qwen 3.6 API,Camera Focus,SORT Tracker,VLM As Detector,Detections Stitch,Clip Comparison,Google Gemma API,MoonshotAI Kimi,Stitch OCR Detections,Event Writer,Buffer,Bounding Rectangle,Time in Zone,Roboflow Asset Library Attributes,Microsoft SQL Server Sink,OpenAI,Roboflow Vision Events,Mask Area Measurement,Detection Offset,CogVLM,Detections Consensus,Object Detection Model,OPC UA Writer Sink,Path Deviation,Dynamic Crop,Byte Tracker,Detections Combine,Qwen3.5-VL,Clip Comparison,SAM 3,OpenAI,Time in Zone,OCR Model,Single-Label Classification Model,Slack Notification,OpenRouter,Detection Event Log,Google Vision OCR,SAM3 Video Tracker,Dynamic Zone,Google Gemma,Stitch OCR Detections,GLM-OCR,SAM 3 Interactive,Twilio SMS/MMS Notification,VLM As Classifier,MoonshotAI Kimi,ByteTrack Tracker,Google Gemini,Byte Tracker,Webhook Sink,Instance Segmentation Model,Path Deviation,MQTT Writer,Object Detection Model,BoT-SORT Tracker,Perspective Correction,Instance Segmentation Model,Seg Preview,Per-Class Confidence Filter,Roboflow Dataset Upload,PLC ModbusTCP,Detections Stabilizer,Detections Merge,Google Gemini,EasyOCR,Dimension Collapse,Local File Sink,SAM 3,Time in Zone,SAM2 Video Tracker,OpenAI,Detections List Roll-Up,Google Gemini,PLC EthernetIP,LMM For Classification,VLM As Detector,Llama 3.2 Vision,Image Stack,Email Notification,Anthropic Claude,Detections Filter,PTZ Tracking (ONVIF),Overlap Filter,Multi-Label Classification Model,Twilio SMS Notification,Email Notification,Byte Tracker,SAM 3,Motion Detection,Current Time,Roboflow Dataset Upload,Moondream2,Segment Anything 2 Model,S3 Sink,Roboflow Custom Metadata,Instance Segmentation Model,Model Monitoring Inference Aggregator,OpenAI-Compatible LLM,Object Detection Model,Anthropic Claude,Line Counter - outputs:
Halo Visualization,Twilio SMS/MMS Notification,Classification Label Visualization,Crop Visualization,VLM As Classifier,Reference Path Visualization,MoonshotAI Kimi,OpenAI,YOLO-World Model,Detections Classes Replacement,Google Gemini,Anthropic Claude,Webhook Sink,Instance Segmentation Model,Size Measurement,Instance Segmentation Model,Path Deviation,Florence-2 Model,Trace Visualization,Ellipse Visualization,Object Detection Model,Keypoint Detection Model,Dot Visualization,Perspective Correction,Label Visualization,Instance Segmentation Model,Florence-2 Model,Seg Preview,Qwen-VL,Llama 3.2 Vision,Roboflow Dataset Upload,Keypoint Detection Model,Keypoint Detection Model,Google Gemini,Qwen 3.5 API,Qwen 3.6 API,SAM 3,Triangle Visualization,Time in Zone,Line Counter,Polygon Visualization,VLM As Detector,OpenAI,Clip Comparison,Google Gemma API,Detections List Roll-Up,Google Gemini,PLC EthernetIP,Halo Visualization,MoonshotAI Kimi,Color Visualization,LMM For Classification,VLM As Detector,Buffer,Llama 3.2 Vision,Polygon Visualization,Email Notification,Mask Visualization,Anthropic Claude,Cache Set,Time in Zone,Roboflow Asset Library Attributes,Keypoint Visualization,Email Notification,Line Counter Visualization,Detections Consensus,Object Detection Model,SAM 3,Path Deviation,VLM As Classifier,Bounding Box Visualization,Motion Detection,Clip Comparison,Roboflow Dataset Upload,Corner Visualization,Polygon Zone Visualization,Grid Visualization,SAM 3,OpenAI,Circle Visualization,Time in Zone,Instance Segmentation Model,Object Detection Model,OpenRouter,Anthropic Claude,Line Counter,SAM3 Video Tracker,Google Gemma
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[instance_segmentation_prediction,object_detection_prediction]): Model predictions to measure the dimensions of..reference_predictions(Union[instance_segmentation_prediction,list_of_values,object_detection_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[string,list_of_values]): 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
]
}