callcut.evaluation.IoUMatcher🔗
- class callcut.evaluation.IoUMatcher(iou_threshold=0.2)[source]🔗
Match intervals using greedy IoU (Intersection over Union).
This matcher pairs ground truth and predicted intervals based on their overlap. It uses a greedy algorithm that prioritizes high-IoU matches.
- Parameters:
- iou_threshold
float Minimum IoU required for a valid match. Pairs with IoU below this threshold are not matched. Default is
0.2.
- iou_threshold
Attributes
Minimum IoU for a valid match.
Methods
match(ground_truth, predictions)Match predicted intervals to ground truth using greedy IoU matching.
Notes
The matching algorithm:
Compute IoU for all (ground_truth, prediction) pairs.
Sort pairs by IoU in descending order.
Greedily assign matches, starting with the highest IoU pair.
Each ground truth and prediction can only be matched once.
Pairs with IoU < threshold are not matched.
Examples
>>> from callcut.evaluation import Interval >>> gt = [Interval(0.0, 1.0), Interval(2.0, 3.0)] >>> pred = [Interval(0.1, 0.9), Interval(2.1, 3.1)] >>> matcher = IoUMatcher(iou_threshold=0.2) >>> matches = matcher.match(gt, pred) >>> len(matches) 2