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