Skip to main content

EmptyFrame

Checks whether there are no labelled detections for a particular amount of time.

Examples:

REST API: WIP Configuration File:

```yaml
elements:
- name: infer
args:
model: person-detection-nano
score_threshold: 0.3
iou_threshold: 0.3
- name: empty-frame
args:
labels: ["person"]
time-threshold: 1200
sources:
- address: videos/apartment.mp4
type: file
```

EmptyFrame Objects

class EmptyFrame(Element)

Raise a flag if there are no labelled detections for a particular amount of time.

Attributes:

  • name str - The name of the element.
  • labels array - Array of labels for which empty frame feature should be checked.
  • time_threshold int - The maximum amount of time in seconds with zero detections.

Examples:

```python
ele = EmptyFrame(labels: ["person"], time_threshold=1200)
```

process

def process(meta: PipelineMetadata)

Process the bounding boxes. This is the main function for this element. It will calculate the time for which the frame or zone is empty for the specified labels and raise a flag if this time crosses time_threshold.

Arguments:

  • meta dict - The metadata to process.

Returns:

  • meta dict - The processed metadata.

Examples:

```python
ele = EmptyFrame(labels: ["person"], time_threshold=1200)
meta = ele.process(meta)
```