Skip to main content

ObjectTrackingOH

Applies object-tracking algorithm to all the detections.

This module provides a pipeline element to track objects throughout the frames. This module takes a bounding box and tracks it by assigning unique id.

Examples:

REST API:

WIP

Configuration File:

```yaml
elements:
- name: infer
args:
model: person-detection-nano
score_threshold: 0.3
iou_threshold: 0.3
- name: object-tracking-OH
args:
max_age: 3
min_hits: 3
history: 50
region: bottom
ratio: 0.2
moving_average: 3
sources:
- address: videos/demo-tracking-28s.mp4
type: file
```

ObjectTrackingOH Objects

class ObjectTrackingOH(Element)

Applies object-tracking algorithm to all the detections.

Attributes:

  • name str - The name of the element.
  • max_age int - the number of consecutive iterations for which the tracker needs to be maintained for any object after it has stopped being detected.
  • min_hits int - the min length of tracking history (in number of points) for which intersection with violation_zone is checked.
  • history int - the length of the list containing history as a cyclic buffer
  • region str - the region of the bounding box that should overlap for the zone intersection to be registered.
  • ratio float - the ratio of the bbox to be considered in the marked perspective for zone intersection to be detected.
  • moving_average int - the average change in a data series over time.

Examples:

```python
ele = ObjectTrackingOH(
max_age=3,
min_hits=3,
history=10,
region="bottom",
ratio=0.1,
moving_average=1
)
```

process

def process(meta: PipelineMetadata)

Process the bounding boxes.

This is the main function for this element. It will take the bounding boxes, assigns unique id to each bounding box and tracks it through the following frames.

Arguments:

  • meta PipelineMetadata - The metadata to process.

Returns:

  • meta PipelineMetadata - The processed metadata.

Examples:

```python
meta = ObjectTrackingOH().process(meta)
```