nicetoolbox.evaluation.data.input_loader.align_arrays¶
- nicetoolbox.evaluation.data.input_loader.align_arrays(predictions: list[nicetoolbox.evaluation.data.input_loader.LoadedArray], ground_truth: list[nicetoolbox.evaluation.data.input_loader.LoadedArray], broadcast_single: bool = False) list[tuple[nicetoolbox.evaluation.data.input_loader.LoadedArray, nicetoolbox.evaluation.data.input_loader.LoadedArray]][source]¶
Pair predictions with ground truth arrays and align their axes.
Matches pairs by shared meta fields (dataset, session, sequence, component). For each pair, all axes (subjects, cameras, frames, labels, data) are intersected so both arrays have identical labels in the same order. Pairs with an empty intersection on any required axis are skipped with a warning.
- Parameters:
predictions – Loaded prediction arrays to match against ground truth.
ground_truth – Loaded ground truth arrays. A single PathMeta entry acts as a wildcard matched to any prediction without a structured match.
broadcast_single – When True, axes where both sides have exactly one element are paired directly regardless of label mismatch, keeping the prediction label.
- Returns:
List of (prediction, ground_truth) pairs with aligned axes.
- Raises:
ValueError – If more than one path-based array is provided on either side.