sportslabkit.metrics.cost_matrix_metrics#

Overview#

Classes#

BaseCostMatrixMetric

A base class for computing the cost matrix between trackers and

IoUCMM

Compute the IoU Cost Matrix Metric between trackers and detections.

EuclideanCMM

Compute the Euclidean Cost Matrix Metric between trackers and

EuclideanCMM2D

A base class for computing the cost matrix between trackers and

CosineCMM

Compute the Cosine Cost Matrix Metric between trackers and

Classes#

class sportslabkit.metrics.cost_matrix_metrics.BaseCostMatrixMetric[source]#

Bases: abc.ABC

A base class for computing the cost matrix between trackers and detections.

Overview

Methods#

compute_metric(trackers, detections)

abc Calculate the metric between trackers and detections.

Members

abstract compute_metric(trackers: collections.abc.Sequence[sportslabkit.types.tracklet.Tracklet], detections: collections.abc.Sequence[sportslabkit.types.detection.Detection]) numpy.ndarray[source]#

Calculate the metric between trackers and detections.

Parameters:
  • trackers – A list of trackers.

  • detections – A list of detections.

Returns:

An array of containing the metric between trackers and detections.

class sportslabkit.metrics.cost_matrix_metrics.IoUCMM(use_pred_box=False)[source]#

Bases: BaseCostMatrixMetric

Compute the IoU Cost Matrix Metric between trackers and detections.

Overview

Methods#

compute_metric(trackers, detections)

Calculate the metric between trackers and detections.

Members

compute_metric(trackers: collections.abc.Sequence[sportslabkit.types.tracklet.Tracklet], detections: collections.abc.Sequence[sportslabkit.types.detection.Detection]) numpy.ndarray[source]#

Calculate the metric between trackers and detections.

Parameters:
  • trackers – A list of trackers.

  • detections – A list of detections.

Returns:

An array of containing the metric between trackers and detections.

class sportslabkit.metrics.cost_matrix_metrics.EuclideanCMM(use_pred_box=False, im_shape: tuple[float, float] = (1080, 1920))[source]#

Bases: BaseCostMatrixMetric

Compute the Euclidean Cost Matrix Metric between trackers and detections.

Overview

Methods#

compute_metric(trackers, detections)

Calculate the metric between trackers and detections.

Members

compute_metric(trackers: collections.abc.Sequence[sportslabkit.types.tracklet.Tracklet], detections: collections.abc.Sequence[sportslabkit.types.detection.Detection]) numpy.ndarray[source]#

Calculate the metric between trackers and detections.

Parameters:
  • trackers – A list of trackers.

  • detections – A list of detections.

Returns:

An array of containing the metric between trackers and detections.

class sportslabkit.metrics.cost_matrix_metrics.EuclideanCMM2D(use_pred_pt=False, im_shape: tuple[float, float] = (1080, 1920))[source]#

Bases: BaseCostMatrixMetric

A base class for computing the cost matrix between trackers and detections.

Overview

Methods#

compute_metric(trackers, detections)

Calculate the metric between trackers and detections.

Members

compute_metric(trackers: collections.abc.Sequence[sportslabkit.types.tracklet.Tracklet], detections: collections.abc.Sequence[sportslabkit.types.detection.Detection]) numpy.ndarray[source]#

Calculate the metric between trackers and detections.

Parameters:
  • trackers – A list of trackers.

  • detections – A list of detections.

Returns:

An array of containing the metric between trackers and detections.

class sportslabkit.metrics.cost_matrix_metrics.CosineCMM[source]#

Bases: BaseCostMatrixMetric

Compute the Cosine Cost Matrix Metric between trackers and detections.

Overview

Methods#

compute_metric(trackers, detections)

Calculate the metric between trackers and detections.

Members

compute_metric(trackers: collections.abc.Sequence[sportslabkit.types.tracklet.Tracklet], detections: collections.abc.Sequence[sportslabkit.types.detection.Detection]) numpy.ndarray[source]#

Calculate the metric between trackers and detections.

Parameters:
  • trackers – A list of trackers.

  • detections – A list of detections.

Returns:

An array of containing the metric between trackers and detections.