Skip to content

Time in Zone

v2

Class: TimeInZoneBlockV2 (there are multiple versions of this block)

Source: inference.core.workflows.core_steps.analytics.time_in_zone.v2.TimeInZoneBlockV2

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 TimeInZoneBlock is an analytics block designed to measure time spent by objects in a zone. 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/time_in_zone@v2to add the block as as step in your workflow.

Properties

Name Type Description Refs
name str Enter a unique identifier for this step..
zone List[Any] Zones (one for each batch) in a format [(x1, y1), (x2, y2), (x3, y3), ...].
triggering_anchor str Triggering anchor. Allowed values: CENTER, CENTER_LEFT, CENTER_RIGHT, TOP_CENTER, TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT, CENTER_OF_MASS.
remove_out_of_zone_detections bool If true, detections found outside of zone will be filtered out.
reset_out_of_zone_detections bool If true, detections found outside of zone will have time reset.

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 Time in Zone in version v2.

Input and Output Bindings

The available connections depend on its binding kinds. Check what binding kinds Time in Zone in version v2 has.

Bindings
  • input

    • image (image): The input image for this step..
    • detections (Union[instance_segmentation_prediction, object_detection_prediction]): Predictions.
    • zone (list_of_values): Zones (one for each batch) in a format [(x1, y1), (x2, y2), (x3, y3), ...].
    • triggering_anchor (string): Triggering anchor. Allowed values: CENTER, CENTER_LEFT, CENTER_RIGHT, TOP_CENTER, TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT, CENTER_OF_MASS.
    • remove_out_of_zone_detections (boolean): If true, detections found outside of zone will be filtered out.
    • reset_out_of_zone_detections (boolean): If true, detections found outside of zone will have time reset.
  • output

    • timed_detections (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 Time in Zone in version v2
{
    "name": "<your_step_name_here>",
    "type": "roboflow_core/time_in_zone@v2",
    "image": "$inputs.image",
    "detections": "$steps.object_detection_model.predictions",
    "zone": "$inputs.zones",
    "triggering_anchor": "CENTER",
    "remove_out_of_zone_detections": true,
    "reset_out_of_zone_detections": true
}

v1

Class: TimeInZoneBlockV1 (there are multiple versions of this block)

Source: inference.core.workflows.core_steps.analytics.time_in_zone.v1.TimeInZoneBlockV1

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 TimeInZoneBlock is an analytics block designed to measure time spent by objects in a zone. 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/time_in_zone@v1to add the block as as step in your workflow.

Properties

Name Type Description Refs
name str Enter a unique identifier for this step..
zone List[Any] Zones (one for each batch) in a format [(x1, y1), (x2, y2), (x3, y3), ...].
triggering_anchor str Triggering anchor. Allowed values: CENTER, CENTER_LEFT, CENTER_RIGHT, TOP_CENTER, TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT, CENTER_OF_MASS.
remove_out_of_zone_detections bool If true, detections found outside of zone will be filtered out.
reset_out_of_zone_detections bool If true, detections found outside of zone will have time reset.

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 Time in Zone in version v1.

Input and Output Bindings

The available connections depend on its binding kinds. Check what binding kinds Time in Zone in version v1 has.

Bindings
  • input

    • image (image): The input image for this step..
    • metadata (video_metadata): not available.
    • detections (Union[instance_segmentation_prediction, object_detection_prediction]): Predictions.
    • zone (list_of_values): Zones (one for each batch) in a format [(x1, y1), (x2, y2), (x3, y3), ...].
    • triggering_anchor (string): Triggering anchor. Allowed values: CENTER, CENTER_LEFT, CENTER_RIGHT, TOP_CENTER, TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT, CENTER_OF_MASS.
    • remove_out_of_zone_detections (boolean): If true, detections found outside of zone will be filtered out.
    • reset_out_of_zone_detections (boolean): If true, detections found outside of zone will have time reset.
  • output

    • timed_detections (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 Time in Zone in version v1
{
    "name": "<your_step_name_here>",
    "type": "roboflow_core/time_in_zone@v1",
    "image": "$inputs.image",
    "metadata": "<block_does_not_provide_example>",
    "detections": "$steps.object_detection_model.predictions",
    "zone": "$inputs.zones",
    "triggering_anchor": "CENTER",
    "remove_out_of_zone_detections": true,
    "reset_out_of_zone_detections": true
}