sportslabkit.motion_model.base#

Overview#

Classes#

BaseMotionModel

Abstract base class for motion models.

Classes#

class sportslabkit.motion_model.base.BaseMotionModel(is_multi_target=False)[source]#

Bases: abc.ABC

Abstract base class for motion models.

This class defines a common interface for all motion models. Derived classes should implement the update, and predict methods. MotionModels are procedural and stateless. The state of tracklet is managed by the Tracklet class. The tracklet must have the required observations and states for the motion model to work. If the tracklet doesn’t have the required observations or states, the motion model will raise an error and tell the user which observations or states are missing.

Overview

Methods#

predict(observations, states)

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

from_config(config)

class Initialize a motion model instance from a configuration dictionary.

Members

hparam_search_space :dict[str, type][source]#
required_observation_types :list[str][source]#
required_state_types :list[str][source]#
abstract predict(observations: float | np.ndarray, states: float | np.ndarray | None) tuple[float | np.ndarray | None, float | np.ndarray][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]]

classmethod from_config(config: dict) BaseMotionModel[source]#

Initialize a motion model instance from a configuration dictionary.

Parameters:

config (Dict) – The configuration dictionary containing the motion model’s parameters.

Returns:

A new instance of the motion model initialized with the given configuration.

Return type:

MotionModel