Skip to content

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 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.

Input and Output Bindings

The available connections depend on its binding kinds. Check what binding kinds Line Counter in version v2 has.

Bindings
  • input

  • 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 if object_detection_prediction or Prediction with detected bounding boxes and segmentation masks in form of sv.Detections(...) object if instance_segmentation_prediction.
    • detections_out (Union[object_detection_prediction, instance_segmentation_prediction]): Prediction with detected bounding boxes in form of sv.Detections(...) object if object_detection_prediction or Prediction with detected bounding boxes and segmentation masks in form of sv.Detections(...) object if instance_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 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.

Input and Output Bindings

The available connections depend on its binding kinds. Check what binding kinds Line Counter in version v1 has.

Bindings
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"
}