nicetoolbox.evaluation.metrics.base_metric.Metric¶
- class nicetoolbox.evaluation.metrics.base_metric.Metric(**kwargs: Any)[source]¶
Bases:
ABCAbstract base class for a single, stateful metric computation.
Initializes the metric. Subclasses can use kwargs for specific setup.
Methods
Compute the final metric from the stored state and return as a dictionary.
Get the metrics output description.
Reset the metric's internal state to prepare for a new run.
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 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.