RandomScorer

class nrtk.impls.score_detections.random_scorer.RandomScorer(seed: int | None = None)

An implementation of the ScoreDetection interface that serves as a simple test for reproduciblity.

An instance of this class acts as a functor to generate scores for a specific metric based on a given set of ground truth and predicted detections.

This class, in particular, implements a random scorer that returns random float values.

Methods

from_config

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

get_config

Returns the current configuration of the RandomScorer 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

Return sequence of random float values equal to the length of the ground truth input.

__init__(seed: int | None = None) None

Initializes the RandomScorer with an optional random seed.

Args:
seed (int | None, optional): An optional seed to ensure reproducibility of random

scores. Defaults to None.

get_config() dict[str, Any]

Returns the current configuration of the RandomScorer instance.

Returns:

dict[str, Any]: Configuration dictionary with current settings.

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

Return sequence of random float values equal to the length of the ground truth input.