Line Counter¶
v2¶
Class: LineCounterBlockV2 (there are multiple versions of this block)
Source: inference.core.workflows.core_steps.analytics.line_counter.v2.LineCounterBlockV2
Warning: This block has multiple versions. Please refer to the specific version for details. You can learn more about how versions work here: Versioning
The LineCounter is an analytics block designed to count objects passing the line.
The block requires detections to be tracked (i.e. each object must have unique tracker_id assigned,
which persists between frames)
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/line_counter@v2to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
line_segment |
List[Any] |
Line consisting of exactly two points. For line [[0, 100], [100, 100]], objects entering from the bottom will count as IN.. | ✅ |
triggering_anchor |
str |
The point on the detection that must cross the line to be counted.. | ✅ |
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 Line Counter in version v2.
- inputs:
VLM as Detector,Byte Tracker,Google Vision OCR,Overlap Filter,SAM 3,Detections Stabilizer,Detections Filter,LMM For Classification,VLM as Classifier,Detections Combine,Model Monitoring Inference Aggregator,Segment Anything 2 Model,Template Matching,Moondream2,Velocity,OCR Model,Florence-2 Model,Detections Transformation,EasyOCR,Buffer,Florence-2 Model,Detection Offset,Slack Notification,Clip Comparison,Instance Segmentation Model,OpenAI,Byte Tracker,Line Counter,PTZ Tracking (ONVIF).md),Object Detection Model,Keypoint Detection Model,Google Gemini,Email Notification,Llama 3.2 Vision,Byte Tracker,Dynamic Zone,YOLO-World Model,Size Measurement,Email Notification,Time in Zone,CogVLM,OpenAI,Roboflow Custom Metadata,Detections Stitch,Stitch OCR Detections,Time in Zone,CSV Formatter,VLM as Detector,OpenAI,Detections Classes Replacement,Perspective Correction,Twilio SMS Notification,Clip Comparison,Single-Label Classification Model,Seg Preview,Roboflow Dataset Upload,Roboflow Dataset Upload,Webhook Sink,Dimension Collapse,Instance Segmentation Model,Multi-Label Classification Model,Time in Zone,Detections Merge,Path Deviation,Anthropic Claude,LMM,Google Gemini,Dynamic Crop,Bounding Rectangle,Path Deviation,Detections Consensus,Local File Sink,Object Detection Model - outputs:
Byte Tracker,Overlap Filter,Classification Label Visualization,Detections Stabilizer,SIFT Comparison,Circle Visualization,Image Contours,Detections Filter,Image Preprocessing,Ellipse Visualization,Triangle Visualization,Stitch Images,Stability AI Inpainting,Detections Combine,QR Code Generator,Image Slicer,Background Color Visualization,Model Monitoring Inference Aggregator,Segment Anything 2 Model,Velocity,Distance Measurement,Dot Visualization,Florence-2 Model,Morphological Transformation,Detections Transformation,Reference Path Visualization,Halo Visualization,SIFT Comparison,Polygon Visualization,Image Slicer,Florence-2 Model,Detection Offset,Slack Notification,Instance Segmentation Model,Byte Tracker,PTZ Tracking (ONVIF).md),Color Visualization,Line Counter,Object Detection Model,Keypoint Detection Model,Label Visualization,Email Notification,Trace Visualization,Byte Tracker,Dynamic Zone,Line Counter,Size Measurement,Email Notification,Corner Visualization,Mask Visualization,Time in Zone,Stability AI Outpainting,Roboflow Custom Metadata,Stitch OCR Detections,Detections Stitch,Blur Visualization,Dominant Color,Time in Zone,Crop Visualization,Grid Visualization,Detections Classes Replacement,Perspective Correction,Twilio SMS Notification,Absolute Static Crop,Roboflow Dataset Upload,Roboflow Dataset Upload,Webhook Sink,Bounding Box Visualization,Line Counter Visualization,Instance Segmentation Model,Icon Visualization,Image Blur,Time in Zone,Pixelate Visualization,Image Threshold,Path Deviation,Detections Merge,Keypoint Detection Model,Anthropic Claude,Identify Outliers,Pixel Color Count,Dynamic Crop,Bounding Rectangle,Path Deviation,Detections Consensus,Model Comparison Visualization,Keypoint Visualization,Identify Changes,Object Detection Model
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Line Counter in version v2 has.
Bindings
-
input
image(image): not available.detections(Union[object_detection_prediction,instance_segmentation_prediction]): Model predictions to count line crossings for..line_segment(list_of_values): Line consisting of exactly two points. For line [[0, 100], [100, 100]], objects entering from the bottom will count as IN..triggering_anchor(string): The point on the detection that must cross the line to be counted..
-
output
count_in(integer): Integer value.count_out(integer): Integer value.detections_in(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.detections_out(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 Line Counter in version v2
{
"name": "<your_step_name_here>",
"type": "roboflow_core/line_counter@v2",
"image": "<block_does_not_provide_example>",
"detections": "$steps.object_detection_model.predictions",
"line_segment": [
[
0,
50
],
[
500,
50
]
],
"triggering_anchor": "CENTER"
}
v1¶
Class: LineCounterBlockV1 (there are multiple versions of this block)
Source: inference.core.workflows.core_steps.analytics.line_counter.v1.LineCounterBlockV1
Warning: This block has multiple versions. Please refer to the specific version for details. You can learn more about how versions work here: Versioning
The LineCounter is an analytics block designed to count objects passing the line.
The block requires detections to be tracked (i.e. each object must have unique tracker_id assigned,
which persists between frames)
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/line_counter@v1to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
line_segment |
List[Any] |
Line consisting of exactly two points. For line [[0, 100], [100, 100]], objects entering from the bottom will count as IN.. | ✅ |
triggering_anchor |
str |
The point on the detection that must cross the line to be counted.. | ✅ |
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 Line Counter in version v1.
- inputs:
VLM as Detector,Byte Tracker,Google Vision OCR,Overlap Filter,SAM 3,Detections Stabilizer,Detections Filter,LMM For Classification,VLM as Classifier,Detections Combine,Model Monitoring Inference Aggregator,Segment Anything 2 Model,Template Matching,Moondream2,Velocity,OCR Model,Florence-2 Model,Detections Transformation,EasyOCR,Buffer,Florence-2 Model,Detection Offset,Slack Notification,Clip Comparison,Instance Segmentation Model,OpenAI,Byte Tracker,Line Counter,PTZ Tracking (ONVIF).md),Object Detection Model,Keypoint Detection Model,Google Gemini,Email Notification,Llama 3.2 Vision,Byte Tracker,Dynamic Zone,YOLO-World Model,Size Measurement,Email Notification,Time in Zone,CogVLM,OpenAI,Roboflow Custom Metadata,Detections Stitch,Stitch OCR Detections,Time in Zone,CSV Formatter,VLM as Detector,OpenAI,Detections Classes Replacement,Perspective Correction,Twilio SMS Notification,Clip Comparison,Single-Label Classification Model,Seg Preview,Roboflow Dataset Upload,Roboflow Dataset Upload,Webhook Sink,Dimension Collapse,Instance Segmentation Model,Multi-Label Classification Model,Time in Zone,Detections Merge,Path Deviation,Anthropic Claude,LMM,Google Gemini,Dynamic Crop,Bounding Rectangle,Path Deviation,Detections Consensus,Local File Sink,Object Detection Model - outputs:
Byte Tracker,Classification Label Visualization,Detections Stabilizer,SIFT Comparison,Circle Visualization,Image Contours,Image Preprocessing,Ellipse Visualization,Triangle Visualization,Stitch Images,Stability AI Inpainting,QR Code Generator,Image Slicer,Dot Visualization,Morphological Transformation,Reference Path Visualization,Halo Visualization,SIFT Comparison,Polygon Visualization,Image Slicer,Detection Offset,Slack Notification,Instance Segmentation Model,Byte Tracker,PTZ Tracking (ONVIF).md),Color Visualization,Object Detection Model,Keypoint Detection Model,Label Visualization,Email Notification,Trace Visualization,Byte Tracker,Dynamic Zone,Email Notification,Corner Visualization,Mask Visualization,Stability AI Outpainting,Stitch OCR Detections,Blur Visualization,Dominant Color,Crop Visualization,Grid Visualization,Detections Classes Replacement,Perspective Correction,Twilio SMS Notification,Absolute Static Crop,Webhook Sink,Bounding Box Visualization,Line Counter Visualization,Instance Segmentation Model,Icon Visualization,Image Blur,Pixelate Visualization,Image Threshold,Keypoint Detection Model,Anthropic Claude,Identify Outliers,Pixel Color Count,Detections Consensus,Keypoint Visualization,Identify Changes,Object Detection Model
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Line Counter in version v1 has.
Bindings
-
input
metadata(video_metadata): not available.detections(Union[object_detection_prediction,instance_segmentation_prediction]): Predictions.line_segment(list_of_values): Line consisting of exactly two points. For line [[0, 100], [100, 100]], objects entering from the bottom will count as IN..triggering_anchor(string): The point on the detection that must cross the line to be counted..
-
output
Example JSON definition of step Line Counter in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/line_counter@v1",
"metadata": "<block_does_not_provide_example>",
"detections": "$steps.object_detection_model.predictions",
"line_segment": [
[
0,
50
],
[
500,
50
]
],
"triggering_anchor": "CENTER"
}