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