Skip to main content

ZoneIntersection

Applies zone intersection between marked zones and the list of detections.

This module provides a pipeline element to detect intersections over a pre-defined keep out zone. This module takes a bounding box and a keep out zone and check if the bounding box intersects with the zone.

Examples:

REST API:

WIP

Configuration File:

```yaml
elements:
- name: infer
args:
model: person-detection-nano
score_threshold: 0.3
iou_threshold: 0.3
- name: detect-zone-intersection
config: conf/zones.json
sources:
- address: videos/demo-tracking-28s.mp4
type: file
```

DetectZoneIntersection Objects

class DetectZoneIntersection(Element)

Applies zone intersection in a marked zone for the list of detections.

Attributes:

  • name str - The name of the element.
  • tracking bool - this flag enables the feature to track bounding boxes that intersect the defined zones.
  • region str - the region of the bounding box that should overlap for the intersection to be registered.
  • ratio float - the ratio of the bbox to be considered in the marked perspective for intersection to be registered.
  • threshold int - min number of zones to intersect for flagging the object id

Examples:

```python
ele = DetectZoneIntersection()
```

process

def process(meta: PipelineMetadata)

Process the bounding boxes.

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

Arguments:

  • meta PipelineMetadata - The metadata to process.

Returns:

  • meta PipelineMetadata - The processed metadata.

Examples:

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