Skip to main content

PeopleTrackingOH

Applies people-tracking algorithm to all the detections.

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

Examples:

REST API:

WIP

Configuration File:

short-from : people-tracking-OH:<i-max_age>:<i-min_hits>:<i-history_buffer>:<s-region_to_check>:<f-ratio>: <i-ma_len>

pipeline:
- person-detection-nano:a:0.3:0.3
- people-tracking-OH:3:3:50:bottom:0.2:3
sources:
- address: videos/demo-tracking-28s.mp4
- type: file

PeopleTrackingOH Objects

class PeopleTrackingOH(Element)

Applies people-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_buffer int - the lenght of the list containing history as a cyclic buffer
  • region_to_check str - the region of the bounding box that should overlap for the intrusion to be registered.
  • ratio float - the ratio of the bbox to be considered in the marked perspective for intrusion to be detected.
  • ma_len int - the average change in a data series over time.

Examples:

ele = PeopleTrackingOH("3", "3", "10", "None", "0.1", "1")

extract_params

 | @staticmethod
| def extract_params(model_params)

Extract the parameters for this element.

Arguments:

  • model_params List[str] - The parameters for this element.

Returns:

  • 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_buffer int - the lenght of the list containing history as a cyclic buffer
  • region_to_check str - the region of the bounding box that should overlap for the intrusion to be registered.
  • ratio float - the ratio of the bbox to be considered in the marked perspective for intrusion to be detected.
  • ma_len int - the average change in a data series over time.

Raises:

  • ExtractParameterException - If the parameters are not valid.

Examples:

params = PeopleTrackingOH.extract_params(["3","3","10","None","0.1","1"])
ele = PeopleTrackingOH(*params)

process

 | def process(meta)

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 trackes it through the following frames.

Arguments:

  • meta dict - The metadata to process.

Returns:

  • meta dict - The processed metadata.

Examples:

ele = PeopleTrackingOH("3", "3", "10", "None", "0.1", "1")
meta = ele.process(meta)