nicetoolbox.evaluation.metrics.base_metric.Metric

class nicetoolbox.evaluation.metrics.base_metric.Metric(**kwargs: Any)[source]

Bases: ABC

Abstract base class for a single, stateful metric computation.

Initializes the metric. Subclasses can use kwargs for specific setup.

Methods

compute

Compute the final metric from the stored state and return as a dictionary.

get_axis3

Get the metrics output description.

reset

Reset the metric's internal state to prepare for a new run.

update

Update metric state with a batch of data and its corresponding metadata.

abstract compute() Dict[Tuple[str, str, str], List[BatchResult] | AggregatedResult][source]

Compute the final metric from the stored state and return as a dictionary.

abstract get_axis3(meta_chunks: List[ChunkWorkItem] | None = None) List[str][source]

Get the metrics output description. E.g. bone names or joint names.

abstract reset() None[source]

Reset the metric’s internal state to prepare for a new run.

abstract update(preds: torch.Tensor, gts: torch.Tensor, meta_chunks: List[ChunkWorkItem], meta_frames: List[FrameInfo]) None[source]

Update metric state with a batch of data and its corresponding metadata.