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