RandomScorer
- class nrtk.impls.score_detections.random_scorer.RandomScorer(seed: int | None = None)
An implementation of the
ScoreDetectioninterface 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_configInstantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.
Returns the current configuration of the RandomScorer instance.
get_default_configGenerate and return a default configuration dictionary for this class.
get_implsDiscover and return a set of classes that implement the calling class.
is_usableCheck whether this class is available for use.
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.