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@v2
to 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 in the format [[x1, y1], [x2, y2]] consisting of exactly two points. For line [[0, 100], [100, 100]] line will count objects entering from the bottom as IN. | ✅ |
triggering_anchor |
str |
Point from the detection for triggering line crossing.. | ✅ |
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:
Time in Zone
,Detections Stitch
,Path Deviation
,Florence-2 Model
,Multi-Label Classification Model
,LMM For Classification
,Instance Segmentation Model
,Keypoint Detection Model
,Single-Label Classification Model
,OCR Model
,Object Detection Model
,Perspective Correction
,Local File Sink
,Line Counter
,Detections Filter
,YOLO-World Model
,Model Monitoring Inference Aggregator
,VLM as Classifier
,VLM as Detector
,Dimension Collapse
,Google Vision OCR
,Size Measurement
,Detections Consensus
,OpenAI
,CogVLM
,Byte Tracker
,Email Notification
,Webhook Sink
,Detections Classes Replacement
,Instance Segmentation Model
,Template Matching
,Roboflow Custom Metadata
,Detection Offset
,Buffer
,Roboflow Dataset Upload
,Clip Comparison
,Roboflow Dataset Upload
,Stitch OCR Detections
,Slack Notification
,Anthropic Claude
,Dynamic Zone
,Google Gemini
,Segment Anything 2 Model
,Clip Comparison
,Byte Tracker
,Time in Zone
,Florence-2 Model
,LMM
,Detections Stabilizer
,Twilio SMS Notification
,Path Deviation
,VLM as Detector
,OpenAI
,Byte Tracker
,CSV Formatter
,Llama 3.2 Vision
,Bounding Rectangle
,Detections Transformation
,Object Detection Model
- outputs:
Stitch Images
,Pixelate Visualization
,Path Deviation
,Keypoint Detection Model
,Line Counter
,Instance Segmentation Model
,Blur Visualization
,Mask Visualization
,Object Detection Model
,Line Counter
,Detections Filter
,Model Monitoring Inference Aggregator
,Polygon Visualization
,Halo Visualization
,Grid Visualization
,Email Notification
,Model Comparison Visualization
,Image Threshold
,Byte Tracker
,Keypoint Visualization
,Detections Classes Replacement
,Image Preprocessing
,Detection Offset
,Slack Notification
,Roboflow Dataset Upload
,Stitch OCR Detections
,Identify Changes
,Background Color Visualization
,Bounding Box Visualization
,Ellipse Visualization
,Label Visualization
,Line Counter Visualization
,Image Contours
,Byte Tracker
,Classification Label Visualization
,Reference Path Visualization
,Stability AI Inpainting
,Dominant Color
,Dynamic Crop
,Byte Tracker
,Triangle Visualization
,Bounding Rectangle
,Absolute Static Crop
,Object Detection Model
,Distance Measurement
,Time in Zone
,Florence-2 Model
,Detections Stitch
,SIFT Comparison
,Keypoint Detection Model
,Corner Visualization
,Perspective Correction
,Trace Visualization
,Image Slicer
,Webhook Sink
,Detections Consensus
,Twilio SMS Notification
,Size Measurement
,Roboflow Custom Metadata
,Instance Segmentation Model
,Crop Visualization
,Roboflow Dataset Upload
,Anthropic Claude
,SIFT Comparison
,Image Blur
,Dot Visualization
,Circle Visualization
,Dynamic Zone
,Segment Anything 2 Model
,Identify Outliers
,Time in Zone
,Florence-2 Model
,Detections Stabilizer
,Path Deviation
,Color Visualization
,Pixel Color Count
,Detections Transformation
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[instance_segmentation_prediction
,object_detection_prediction
]): Predictions.line_segment
(list_of_values
): Line in the format [[x1, y1], [x2, y2]] consisting of exactly two points. For line [[0, 100], [100, 100]] line will count objects entering from the bottom as IN.triggering_anchor
(string
): Point from the detection for triggering line crossing..
-
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_prediction
or 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_prediction
or 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@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.. | ❌ |
line_segment |
List[Any] |
Line in the format [[x1, y1], [x2, y2]] consisting of exactly two points. For line [[0, 100], [100, 100]] line will count objects entering from the bottom as IN. | ✅ |
triggering_anchor |
str |
Point from the detection for triggering line crossing.. | ✅ |
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:
Time in Zone
,Detections Stitch
,Path Deviation
,Florence-2 Model
,Multi-Label Classification Model
,LMM For Classification
,Instance Segmentation Model
,Keypoint Detection Model
,Single-Label Classification Model
,OCR Model
,Object Detection Model
,Perspective Correction
,Local File Sink
,Line Counter
,Detections Filter
,YOLO-World Model
,Model Monitoring Inference Aggregator
,VLM as Classifier
,VLM as Detector
,Dimension Collapse
,Google Vision OCR
,Size Measurement
,Detections Consensus
,OpenAI
,CogVLM
,Byte Tracker
,Email Notification
,Webhook Sink
,Detections Classes Replacement
,Instance Segmentation Model
,Template Matching
,Roboflow Custom Metadata
,Detection Offset
,Buffer
,Roboflow Dataset Upload
,Clip Comparison
,Roboflow Dataset Upload
,Stitch OCR Detections
,Slack Notification
,Anthropic Claude
,Dynamic Zone
,Google Gemini
,Segment Anything 2 Model
,Clip Comparison
,Byte Tracker
,Time in Zone
,Florence-2 Model
,LMM
,Detections Stabilizer
,Twilio SMS Notification
,Path Deviation
,VLM as Detector
,OpenAI
,Byte Tracker
,CSV Formatter
,Llama 3.2 Vision
,Bounding Rectangle
,Detections Transformation
,Object Detection Model
- outputs:
Stitch Images
,Pixelate Visualization
,Keypoint Detection Model
,Instance Segmentation Model
,Blur Visualization
,Mask Visualization
,Object Detection Model
,Polygon Visualization
,Halo Visualization
,Grid Visualization
,Email Notification
,Image Threshold
,Byte Tracker
,Keypoint Visualization
,Image Preprocessing
,Detection Offset
,Slack Notification
,Stitch OCR Detections
,Identify Changes
,Bounding Box Visualization
,Ellipse Visualization
,Label Visualization
,Line Counter Visualization
,Image Contours
,Byte Tracker
,Classification Label Visualization
,Reference Path Visualization
,Dominant Color
,Byte Tracker
,Triangle Visualization
,Absolute Static Crop
,Object Detection Model
,SIFT Comparison
,Keypoint Detection Model
,Corner Visualization
,Perspective Correction
,Trace Visualization
,Image Slicer
,Webhook Sink
,Detections Consensus
,Twilio SMS Notification
,Instance Segmentation Model
,Crop Visualization
,Anthropic Claude
,SIFT Comparison
,Image Blur
,Dot Visualization
,Circle Visualization
,Dynamic Zone
,Identify Outliers
,Detections Stabilizer
,Color Visualization
,Pixel Color Count
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[instance_segmentation_prediction
,object_detection_prediction
]): Predictions.line_segment
(list_of_values
): Line in the format [[x1, y1], [x2, y2]] consisting of exactly two points. For line [[0, 100], [100, 100]] line will count objects entering from the bottom as IN.triggering_anchor
(string
): Point from the detection for triggering line crossing..
-
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"
}