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