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:
Moondream2,Detections Stitch,Velocity,Instance Segmentation Model,LMM,Line Counter,Time in Zone,Instance Segmentation Model,Dynamic Crop,Multi-Label Classification Model,Webhook Sink,Google Gemini,Single-Label Classification Model,Anthropic Claude,Email Notification,Keypoint Detection Model,EasyOCR,OCR Model,Detections Classes Replacement,Detections Consensus,Llama 3.2 Vision,SAM 3,OpenAI,SAM 3,OpenAI,Roboflow Custom Metadata,Florence-2 Model,Twilio SMS Notification,Perspective Correction,Dynamic Zone,VLM as Detector,Google Gemini,CSV Formatter,Detections Transformation,PTZ Tracking (ONVIF).md),Roboflow Dataset Upload,Stitch OCR Detections,Local File Sink,CogVLM,Detections Merge,Slack Notification,Path Deviation,Detections Combine,Model Monitoring Inference Aggregator,Dimension Collapse,Overlap Filter,Time in Zone,Size Measurement,Object Detection Model,Email Notification,Time in Zone,Object Detection Model,Template Matching,VLM as Detector,Florence-2 Model,LMM For Classification,Bounding Rectangle,OpenAI,Roboflow Dataset Upload,YOLO-World Model,SAM 3,Detections Filter,Path Deviation,Motion Detection,Byte Tracker,Clip Comparison,Clip Comparison,Seg Preview,Google Vision OCR,VLM as Classifier,Segment Anything 2 Model,Byte Tracker,Buffer,Byte Tracker,Detections Stabilizer,Detection Offset,OpenAI,Anthropic Claude - outputs:
Blur Visualization,Line Counter Visualization,Detections Stitch,Velocity,Instance Segmentation Model,Line Counter,Time in Zone,Instance Segmentation Model,Dominant Color,Dynamic Crop,Circle Visualization,Absolute Static Crop,Webhook Sink,Mask Visualization,Ellipse Visualization,Identify Outliers,Email Notification,Anthropic Claude,Color Visualization,Keypoint Detection Model,Image Preprocessing,Detections Classes Replacement,Detections Consensus,SIFT Comparison,Twilio SMS Notification,Roboflow Custom Metadata,Trace Visualization,Line Counter,Florence-2 Model,Perspective Correction,Dynamic Zone,Grid Visualization,Stability AI Outpainting,QR Code Generator,Detections Transformation,Reference Path Visualization,PTZ Tracking (ONVIF).md),Stability AI Inpainting,Roboflow Dataset Upload,Stitch OCR Detections,Bounding Box Visualization,Image Slicer,Corner Visualization,Polygon Visualization,Detections Merge,Slack Notification,Path Deviation,Detections Combine,Triangle Visualization,Pixelate Visualization,Model Monitoring Inference Aggregator,Icon Visualization,Overlap Filter,Time in Zone,Classification Label Visualization,Background Color Visualization,Keypoint Visualization,Background Subtraction,Size Measurement,Dot Visualization,Pixel Color Count,Object Detection Model,Email Notification,Crop Visualization,Stitch Images,Object Detection Model,Time in Zone,Florence-2 Model,Bounding Rectangle,Image Contours,Keypoint Detection Model,Roboflow Dataset Upload,Halo Visualization,Detections Filter,Model Comparison Visualization,SIFT Comparison,Distance Measurement,Path Deviation,Motion Detection,Byte Tracker,Morphological Transformation,Segment Anything 2 Model,Byte Tracker,Byte Tracker,Detections Stabilizer,Image Blur,Image Threshold,Image Slicer,Detection Offset,Anthropic Claude,Label Visualization,Identify Changes
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:
Moondream2,Detections Stitch,Velocity,Instance Segmentation Model,LMM,Line Counter,Time in Zone,Instance Segmentation Model,Dynamic Crop,Multi-Label Classification Model,Webhook Sink,Google Gemini,Single-Label Classification Model,Anthropic Claude,Email Notification,Keypoint Detection Model,EasyOCR,OCR Model,Detections Classes Replacement,Detections Consensus,Llama 3.2 Vision,SAM 3,OpenAI,SAM 3,OpenAI,Roboflow Custom Metadata,Florence-2 Model,Twilio SMS Notification,Perspective Correction,Dynamic Zone,VLM as Detector,Google Gemini,CSV Formatter,Detections Transformation,PTZ Tracking (ONVIF).md),Roboflow Dataset Upload,Stitch OCR Detections,Local File Sink,CogVLM,Detections Merge,Slack Notification,Path Deviation,Detections Combine,Model Monitoring Inference Aggregator,Dimension Collapse,Overlap Filter,Time in Zone,Size Measurement,Object Detection Model,Email Notification,Time in Zone,Object Detection Model,Template Matching,VLM as Detector,Florence-2 Model,LMM For Classification,Bounding Rectangle,OpenAI,Roboflow Dataset Upload,YOLO-World Model,SAM 3,Detections Filter,Path Deviation,Motion Detection,Byte Tracker,Clip Comparison,Clip Comparison,Seg Preview,Google Vision OCR,VLM as Classifier,Segment Anything 2 Model,Byte Tracker,Buffer,Byte Tracker,Detections Stabilizer,Detection Offset,OpenAI,Anthropic Claude - outputs:
Blur Visualization,Line Counter Visualization,Instance Segmentation Model,Instance Segmentation Model,Dominant Color,Circle Visualization,Absolute Static Crop,Webhook Sink,Mask Visualization,Ellipse Visualization,Identify Outliers,Email Notification,Anthropic Claude,Color Visualization,Keypoint Detection Model,Image Preprocessing,Detections Classes Replacement,Detections Consensus,SIFT Comparison,Twilio SMS Notification,Trace Visualization,Perspective Correction,Dynamic Zone,Grid Visualization,Stability AI Outpainting,QR Code Generator,Reference Path Visualization,PTZ Tracking (ONVIF).md),Stability AI Inpainting,Stitch OCR Detections,Bounding Box Visualization,Image Slicer,Corner Visualization,Polygon Visualization,Slack Notification,Triangle Visualization,Pixelate Visualization,Icon Visualization,Classification Label Visualization,Keypoint Visualization,Background Subtraction,Dot Visualization,Pixel Color Count,Object Detection Model,Email Notification,Crop Visualization,Stitch Images,Object Detection Model,Image Contours,Keypoint Detection Model,Halo Visualization,SIFT Comparison,Motion Detection,Byte Tracker,Morphological Transformation,Byte Tracker,Byte Tracker,Detections Stabilizer,Image Blur,Image Threshold,Image Slicer,Detection Offset,Anthropic Claude,Label Visualization,Identify Changes
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"
}