sportslabkit.motion_model.models.ema#

Overview#

Classes#

ExponentialMovingAverage

Exponential Moving Average (EMA) motion model for object tracking.

Classes#

class sportslabkit.motion_model.models.ema.ExponentialMovingAverage(gamma: float = 0.5)[source]#

Bases: sportslabkit.motion_model.base.BaseMotionModel

Exponential Moving Average (EMA) motion model for object tracking.

This class implements an EMA-based motion model for object tracking. It can be used both in a stateful and a procedural manner.

gamma#

The weight for the exponential moving average calculation.

Type:

float

_value#

The internal state of the motion model.

Type:

Union[float, np.ndarray, None]

Overview

Methods#

predict(observations, states)

Compute the next internal state and prediction based on the current observation and internal state.

Members

hparam_search_space :dict[str, dict[str, object]][source]#
required_observation_types = ['box'][source]#
required_state_types = ['EMA_t'][source]#
predict(observations: dict[str, Any], states: dict[str, float | np.ndarray[Any, Any]] = ...) tuple[numpy.ndarray[Any, Any], dict[str, float | np.ndarray[Any, Any]]][source]#

Compute the next internal state and prediction based on the current observation and internal state.

Parameters:
  • observation (Union[float, np.ndarray]) – The current observation.

  • states (Union[float, np.ndarray, None]) – The current internal state of the motion model.

Returns:

The next internal state and the prediction.

Return type:

Tuple[Union[float, np.ndarray, None], Union[float, np.ndarray]]