COCOScorer

class nrtk.impls.score_detections.coco_scorer.COCOScorer(gt_path: str, stat_index: int = 0)

An implementation of the ScoreDetection interface that conforms to the COCO data formatting and metrics.

An instance of this class reads in the path to the ground truth data and specifies a particular statistic index. Finally, the call to the scorer method returns a set of float metric values for the specified statistic index.

Methods

from_config

Instantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.

get_config

Returns the configuration dictionary for the COCOScorer instance.

get_default_config

Generate and return a default configuration dictionary for this class.

get_impls

Discover and return a set of classes that implement the calling class.

is_usable

Check whether this class is available for use.

score

Computes scores for a particular statistic index.

__init__(gt_path: str, stat_index: int = 0) None

Initializes the COCOScorer with a path to the ground truth data and a statistic index.

Args:

gt_path (str): Path to the COCO-formatted ground truth JSON file. stat_index (int): Index of the statistic to retrieve from the COCO evaluation. Defaults to 0.

get_config() dict[str, Any]

Returns the configuration dictionary for the COCOScorer instance.

Returns:

dict[str, Any]: Configuration dictionary containing the ground truth path and statistic index.

score(actual: Sequence[Sequence[tuple[AxisAlignedBoundingBox, dict[Hashable, Any]]]], predicted: Sequence[Sequence[tuple[AxisAlignedBoundingBox, dict[Hashable, float]]]]) Sequence[float]

Computes scores for a particular statistic index.

Computes scores for a particular statistic index and returns sequences of float values equal to the length of the input data.