nicetoolbox.evaluation.metrics.categorical.Recall¶
- class nicetoolbox.evaluation.metrics.categorical.Recall[source]¶
Bases:
_BinaryClassificationMetricCalculate the recall for binary classification.
- Returns:
Dictionary with key (component, algorithm, person, camera, “recall”) and the corresponding aggregated recall value.
- Return type:
Dict[Tuple[str, str, str, str, str], MetricReturnType]
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: counts of TP, TN, FP, FN.
Update metric state with a batch of data and its corresponding metadata, accumulating counts of true positives, true negatives, false positives, and false negatives.
- compute() Dict[Tuple[str, str, str, str, str], List[BatchResult] | AggregatedResult][source]¶
Compute the final metric from the stored state and return as a dictionary.
- get_axis3()¶
Get the metrics output description. E.g. bone names or joint names.
- reset() None¶
Reset the metric’s internal state: counts of TP, TN, FP, FN.
- update(preds: torch.Tensor, gts: torch.Tensor, meta_chunk: ChunkWorkItem, meta_frames: List[FrameInfo]) None¶
Update metric state with a batch of data and its corresponding metadata, accumulating counts of true positives, true negatives, false positives, and false negatives. Assumes binary classification with predictions and ground truths as boolean tensors.
- Parameters:
preds (torch.Tensor) – Predictions tensor (binary).
gts (torch.Tensor) – Ground truth tensor (binary).
meta_chunk (ChunkWorkItem) – Metadata for the chunk.
meta_frames (List[FrameInfo]) – List of frame metadata.