Hive.evaluation.detection.matching module#

Hive.evaluation.detection.matching.matching_batch(iou_fn, iou_thresholds, pred_boxes, pred_classes, pred_scores, gt_boxes, gt_classes, gt_ignore, max_detections=100)[source]#

Match boxes of a batch to corresponding ground truth for each category independently

Parameters:
  • iou_fn (Callable[[ndarray, ndarray], ndarray]) – compute overlap for each pair

  • iou_thresholds (Sequence[float]) – defined which IoU thresholds should be evaluated

  • pred_boxes (Sequence[ndarray]) – predicted boxes from single batch; List[[D, dim * 2]], D number of predictions

  • pred_classes (Sequence[ndarray]) – predicted classes from a single batch; List[[D]], D number of predictions

  • pred_scores (Sequence[ndarray]) – predicted score for each bounding box; List[[D]], D number of predictions

  • gt_boxes (Sequence[ndarray]) – ground truth boxes; List[[G, dim * 2]], G number of ground truth

  • gt_classes (Sequence[ndarray]) – ground truth classes; List[[G]], G number of ground truth

  • gt_ignore (Sequence[Sequence[bool]]) – specified if which ground truth boxes are not counted as true positives (detections which match theses boxes are not counted as false positives either); List[[G]], G number of ground truth

  • max_detections (int) – maximum number of detections which should be evaluated

Return type:

List[Dict[int, Dict[str, ndarray]]]

Returns:

List[Dict[int, Dict[str, np.ndarray]]]

matched detections [dtMatches] and ground truth [gtMatches] boxes [str, np.ndarray] for each category (stored in dict keys) for each image (list)