def compute_match_ioa(ioa, is_box):
      """Computes TP/FP for group-of box matching.

      The function updates the following local variables:
        is_matched_to_group_of - if a box is matched to group-of
        is_matched_to_box - the detections that were processed at this stage are
          marked as is_box.

      Args:
        ioa: intersection-over-area matrix [num_gt_boxes]x[num_det_boxes].
        is_box: boolean that specifies if currently boxes or masks are
          processed.

      Returns:
        scores_group_of: of detections matched to group-of boxes
        [num_groupof_matched].
        tp_fp_labels_group_of: boolean array of size [num_groupof_matched], all
          values are True.
      """
      scores_group_of = np.zeros(ioa.shape[1], dtype=float)
      tp_fp_labels_group_of = self.group_of_weight * np.ones(
          ioa.shape[1], dtype=float)
      max_overlap_group_of_gt_ids = np.argmax(ioa, axis=1)
      for i in range(num_detected_boxes):
        gt_id = max_overlap_group_of_gt_ids[i]
        is_evaluatable = (not tp_fp_labels[i] and
                          not is_matched_to_difficult[i] and
                          ioa[i, gt_id] >= self.matching_iou_threshold and
                          not is_matched_to_group_of[i])
        if is_evaluatable:
          is_matched_to_group_of[i] = True
          is_matched_to_box[i] = is_box
          scores_group_of[gt_id] = max(scores_group_of[gt_id], scores[i])
      selector = np.where((scores_group_of > 0) & (tp_fp_labels_group_of > 0))
      scores_group_of = scores_group_of[selector]
      tp_fp_labels_group_of = tp_fp_labels_group_of[selector]

      return scores_group_of, tp_fp_labels_group_of
Computes TP/FP for group-of box matching.

      The function updates the following local variables:
        is_matched_to_group_of - if a box is matched to group-of
        is_matched_to_box - the detections that were processed at this stage are
          marked as is_box.

      Args:
        ioa: intersection-over-area matrix [num_gt_boxes]x[num_det_boxes].
        is_box: boolean that specifies if currently boxes or masks are
          processed.

      Returns:
        scores_group_of: of detections matched to group-of boxes
        [num_groupof_matched].
        tp_fp_labels_group_of: boolean array of size [num_groupof_matched], all
          values are True.
      
inference_api/src/main/object_detection/utils/per_image_evaluation.py