Skip to main content

ObjectTracking

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
mode: a
score_threshold: 0.3
iou_threshold: 0.3
- name: object-tracking
args:
max_age: 3
history: 50
sampling_frequency: 25
sources:
- address: videos/demo-tracking-28s.mp4
type: file
```

ObjectTracking Objects

class ObjectTracking(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.
  • history int - The max length (in number of points) for which the tracking history can be retained. The larger this value the longer the trace for any detected box.
  • sampling_frequency int - The frequency at which the centroid coordinates of the tracker are appended to the history list

Examples:

```python
ele = ObjectTracking(max_age=3, history=50, sampling_frequency=25)
```

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 = ObjectTracking(max_age=3, history=50, sampling_frequency=25).process(meta)
```