MovingAverage
Calculate Moving Avg of Detection Count.
This module provides a pipeline element to calculate the moving avg of the detection count measured across a certain pre-defined window. There is an optional argument to specify the moving average window.
Examples:
REST API:
WIP
Configuration File:
short-from : moving-average
, moving-average:<i-wndw>
Moving Avg with default:
source:
- address: https://youtu.be/jY86pXeTOLw
- type: youtube
pipeline:
- person-detection-nano:a:0.3:0.3
- moving-average
Moving Avg with window specified:
source:
- address: https://youtu.be/jY86pXeTOLw
- type: youtube
pipeline:
- person-detection-nano:a:0.3:0.3
- moving-average:10
MovingAverage Objects
class MovingAverage(Element)
Calculate Moving Avg of Detection Count.
This element calculates moving avg of the detection count measured across a certain pre-defined window.
Attributes:
name
str - The name of the element.wndw
int - The moving average window.
Examples:
Default:
ele = MovingAverage()
ele = MovingAverage(10)
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:
wndw
int - The moving average window.
Raises:
ExtractParameterException
- If the parameters are not valid.
Examples:
params = MovingAverage.extract_params(["10"])
ele = MovingAverage(*params)
process
def process(meta)
Process the bounding boxes.
This is the main function for this element. It will calculate moving avg of the detection count measured across a certain pre-defined window.
Arguments:
meta
dict - The metadata to process.
Returns:
meta
dict - The processed metadata.
Examples:
ele = MovingAverage()
meta = ele.process(meta)