Velocity¶
Class: VelocityBlockV1
Source: inference.core.workflows.core_steps.analytics.velocity.v1.VelocityBlockV1
The VelocityBlock computes the velocity and speed of objects tracked across video frames.
It includes options to smooth the velocity and speed measurements over time and to convert units from pixels per second to meters per second.
It requires detections from Byte Track with unique tracker_id assigned to each object, which persists between frames.
The velocities are calculated based on the displacement of object centers over time.
Note: due to perspective and camera distortions calculated velocity will be different depending on object position in relation to the camera.
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/velocity@v1to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
smoothing_alpha |
float |
Smoothing factor (alpha) for exponential moving average (0 < alpha <= 1). Lower alpha means more smoothing.. | ✅ |
pixels_per_meter |
float |
Conversion from pixels to meters. Velocity will be converted to meters per second using this value.. | ✅ |
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 Velocity in version v1.
- inputs:
VLM as Detector,Byte Tracker,Google Vision OCR,Overlap Filter,SAM 3,Detections Stabilizer,Time in Zone,VLM as Detector,Detections Filter,Detections Classes Replacement,Perspective Correction,Seg Preview,Detections Combine,Segment Anything 2 Model,Template Matching,Moondream2,Velocity,OCR Model,Camera Focus,Instance Segmentation Model,Detections Transformation,EasyOCR,Gaze Detection,Time in Zone,Detection Offset,Instance Segmentation Model,Detections Merge,Path Deviation,Line Counter,Byte Tracker,PTZ Tracking (ONVIF).md),Object Detection Model,Byte Tracker,Cosine Similarity,Dynamic Zone,Dynamic Crop,Bounding Rectangle,Path Deviation,Detections Consensus,YOLO-World Model,Time in Zone,Identify Changes,Detections Stitch,Object Detection Model - outputs:
Byte Tracker,Overlap Filter,Blur Visualization,Detections Stabilizer,Circle Visualization,Time in Zone,Crop Visualization,Detections Filter,Detections Classes Replacement,Perspective Correction,Ellipse Visualization,Triangle Visualization,Roboflow Dataset Upload,Detections Combine,Stability AI Inpainting,Detections Stitch,Roboflow Dataset Upload,Background Color Visualization,Model Monitoring Inference Aggregator,Segment Anything 2 Model,Velocity,Distance Measurement,Dot Visualization,Florence-2 Model,Bounding Box Visualization,Detections Transformation,Halo Visualization,Icon Visualization,Polygon Visualization,Florence-2 Model,Time in Zone,Detection Offset,Pixelate Visualization,Path Deviation,Byte Tracker,PTZ Tracking (ONVIF).md),Color Visualization,Line Counter,Detections Merge,Label Visualization,Byte Tracker,Trace Visualization,Dynamic Zone,Dynamic Crop,Bounding Rectangle,Path Deviation,Line Counter,Detections Consensus,Model Comparison Visualization,Size Measurement,Corner Visualization,Mask Visualization,Time in Zone,Roboflow Custom Metadata,Stitch OCR Detections
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Velocity in version v1 has.
Bindings
-
input
image(image): not available.detections(Union[object_detection_prediction,instance_segmentation_prediction]): Model predictions to calculate the velocity for..smoothing_alpha(float): Smoothing factor (alpha) for exponential moving average (0 < alpha <= 1). Lower alpha means more smoothing..pixels_per_meter(float): Conversion from pixels to meters. Velocity will be converted to meters per second using this value..
-
output
velocity_detections(Union[object_detection_prediction,instance_segmentation_prediction]): Prediction with detected bounding boxes in form of sv.Detections(...) object ifobject_detection_predictionor Prediction with detected bounding boxes and segmentation masks in form of sv.Detections(...) object ifinstance_segmentation_prediction.
Example JSON definition of step Velocity in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/velocity@v1",
"image": "<block_does_not_provide_example>",
"detections": "$steps.object_detection_model.predictions",
"smoothing_alpha": 0.5,
"pixels_per_meter": 0.01
}