sportslabkit.types.detection#

Overview#

Classes#

Detection

Detection represents an object detected in an image.

Classes#

class sportslabkit.types.detection.Detection(box: sportslabkit.types.types.Box, score: float | None = None, class_id: int | None = None, feature: Vector | None = None)[source]#

Detection represents an object detected in an image.

The Detection class expects the following inputs:

box (np.ndarray): The bounding box of the detected object. The shape is (4,). score (float, optional): The confidence score of the detection. class_id (int, optional): The class of the detected object. feature (np.ndarray, optional): The feature vector of the detected object. The shape is (1, N).

Parameters:
  • box (np.ndarray) – The bounding box of the detected object. Should be an array of shape (4,).

  • score (float, optional) – The confidence score of the detection.

  • class_id (int, optional) – The class of the detected object.

  • feature (np.ndarray, optional) – The feature vector of the detected object. Should be an array of shape (1, N).

_box#

The bounding box of the detected object.

Type:

np.ndarray

_score#

The confidence score of the detection.

Type:

float, optional

_class_id#

The class of the detected object.

Type:

int, optional

_feature#

The feature vector of the detected object.

Type:

np.ndarray, optional

Raises:

ValueError – If the box does not have the shape (4,).