nicetoolbox.evaluation.metrics.keypoint

Keypoint metrics for evaluating 3D joints data. Includes bone length calculation and jump detection metrics. No ground truth required.

Classes

BoneLength

Calculates the bone lengths for each frame using 3D only keypoints.

JumpDetection

Detects jumps in keypoint sequences based on sudden large movements.

KeypointMetric

Handler for all keypoint metrics.

class nicetoolbox.evaluation.metrics.keypoint.BoneLength(keypoints_mapping: Dict[str, Any])[source]

Calculates the bone lengths for each frame using 3D only keypoints.

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

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

Compute the final metric from the stored state.

get_axis3() List[str][source]

Get the bone names the metric is concerned with.

reset() None[source]

Reset the metric’s internal state.

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

Computes the bone lengths and stores them.

class nicetoolbox.evaluation.metrics.keypoint.JumpDetection(keypoints_mapping: Dict[str, Any])[source]

Detects jumps in keypoint sequences based on sudden large movements.

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

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

Compute the final metric, returning both frame-based results and a summary.

get_axis3(meta_chunk: ChunkWorkItem) List[str][source]

Get the names of the joints used for jump detection.

reset() None[source]

Initializes and resets the metric’s internal state.

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

Detects jumps and stores the results.

class nicetoolbox.evaluation.metrics.keypoint.KeypointMetric(cfg: EvaluationMetricType, device: str)[source]

Handler for all keypoint metrics.

Initialize the metric handler with its config and device, creating its metrics.

Parameters:
  • cfg (MetricTypeConfig) – Configuration for this metric type.

  • device (str) – Device to run the metrics on (e.g., ‘cpu’ or ‘cuda’).

property name: str

The name of the metric handler (e.g., ‘point_cloud_metrics’).