Skip to main content

MotionSegmenter

Drop bounding boxes if there hasn't been any significant change in their location.

This module provides a pipeline element to drop bounding boxes if there hasn't been any significant change in their location. The IoU threshold is the maximum amount of IoU allowable between the current and previous bounding box to keep it.

Examples:

REST API:

WIP

Configuration File:

source:
- address: https://youtu.be/jY86pXeTOLw
- `type` - youtube
elements:
- name: infer
args:
- `model` - person-detection-medium
- `mode` - a
- `score_threshold` - 0.3
- `iou_threshold` - 0.3
- name: motion-segmenter

get_iou

def get_iou(box1, box2, h, w)

Implement the intersection over union (IoU) between box1 and box2

Arguments:

  • box1 - first box, numpy array with coordinates (ymin, xmin, ymax, xmax)
  • box2 - second box, numpy array with coordinates (ymin, xmin, ymax, xmax)

MotionSegmenter Objects

class MotionSegmenter(Element)

Only make motion visible in the image.

Attributes:

  • name str - The name of the element.

Examples:

ele = MotionSegmenter()

process

def process(meta)

Drop metadata if there hasn't been any significant change in the bounding boxes.

This is the main function for this element. it will process the metadata and drop bounding boxes if there hasn't been any significant change in their location.

Arguments:

  • meta dict - The metadata to process.

Returns:

  • meta dict - The processed metadata.

Examples:

ele = MotionSegmenter()
meta = ele.process(meta)