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@v1
to 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:
Detections Stabilizer
,Path Deviation
,Time in Zone
,Path Deviation
,Perspective Correction
,Gaze Detection
,Detections Transformation
,Instance Segmentation Model
,Byte Tracker
,Byte Tracker
,PTZ Tracking (ONVIF)
.md),Byte Tracker
,Cosine Similarity
,Object Detection Model
,Velocity
,Detections Classes Replacement
,YOLO-World Model
,Detections Merge
,Time in Zone
,VLM as Detector
,Template Matching
,Instance Segmentation Model
,Dynamic Zone
,Dynamic Crop
,Time in Zone
,Line Counter
,Detections Consensus
,Moondream2
,Overlap Filter
,Google Vision OCR
,Segment Anything 2 Model
,Detections Stitch
,Bounding Rectangle
,Detection Offset
,Camera Focus
,Object Detection Model
,Identify Changes
,Detections Filter
,VLM as Detector
- outputs:
Detections Stabilizer
,Roboflow Dataset Upload
,Circle Visualization
,Path Deviation
,Time in Zone
,Path Deviation
,Perspective Correction
,Color Visualization
,Detections Transformation
,Mask Visualization
,Byte Tracker
,Byte Tracker
,Florence-2 Model
,Blur Visualization
,PTZ Tracking (ONVIF)
.md),Pixelate Visualization
,Byte Tracker
,Velocity
,Dot Visualization
,Stability AI Inpainting
,Roboflow Dataset Upload
,Detections Classes Replacement
,Detections Merge
,Icon Visualization
,Time in Zone
,Roboflow Custom Metadata
,Model Monitoring Inference Aggregator
,Polygon Visualization
,Dynamic Zone
,Dynamic Crop
,Crop Visualization
,Stitch OCR Detections
,Time in Zone
,Ellipse Visualization
,Detections Consensus
,Line Counter
,Trace Visualization
,Bounding Box Visualization
,Distance Measurement
,Segment Anything 2 Model
,Overlap Filter
,Label Visualization
,Line Counter
,Corner Visualization
,Detections Stitch
,Bounding Rectangle
,Size Measurement
,Detection Offset
,Model Comparison Visualization
,Background Color Visualization
,Detections Filter
,Florence-2 Model
,Halo Visualization
,Triangle Visualization
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[instance_segmentation_prediction
,object_detection_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_prediction
or 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
}