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