Skip to main content

IntrusionDetection

Applies intrusion detection in a marked zone for the list of detections.

This module provides a pipeline element to detect intrusion over a pre-defined keep out zone. This module takes a bounding box and a keep out zone and check if th bounding box overlaps over the zone.

Examples:

REST API:

WIP

Configuration File:

short-from : intrusion-detection:<s-zone_config_path>:<s-intrusion_tracking>:<s-region_to_check>: <f-ratio>

pipeline:
- person-detection-nano:a:0.3:0.3
- intrusion-detection:conf/violation_zone.json
sources:
- address: videos/demo-tracking-28s.mp4
- type: file

IntrusionDetection Objects

class IntrusionDetection(Element)

Applies intrusion detection in a marked zone for the list of detections.

Attributes:

  • name str - The name of the element.
  • zone_config_path str - this relative path to the json file marking the violation zones.
  • intrusion_tracking str - this flag enables the feature to track bounding boxes that violate the defined zones.
  • 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.

Examples:

ele = IntrusionDetection("conf/violation_zone.json")

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:

  • zone_config_path str - this relative path to the json file marking the violation zone
  • intrusion_tracking str - this flag enables the feature to track bounding boxes that violate the defined zones.
  • 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.

Raises:

  • ExtractParameterException - If the parameters are not valid.

Examples:

params = IntrusionDetection.extract_params(["conf/violation_zone.json"])
ele = IntrusionDetection(*params)

process

 | def process(meta)

Process the bounding boxes.

This is the main function for this element. It will take the bounding boxes and detects any overlap with the keep out zone, the intruding bounding boxes are flagged.

Arguments:

  • meta dict - The metadata to process.

Returns:

  • meta dict - The processed metadata.

Examples:

ele = IntrusionDetection("conf/violation_zone.json")
meta = ele.process(meta)