class_docstr: Abstract class to calculate average precision and recall for various vision tasks.
  
  Parameters
  ----------
  max_dets: Union[List[int], Tuple[int]], default: [1, 10, 100]
      Maximum number of detections per class.
  area_range: tuple, default: (32**2, 96**2)
      Slices for small/medium/large buckets.
  return_option: str, default: 'ap'
      ap: ap only, ar: ar only, None: all (not ignite compliant).
  average: str, default: none
      The method for averaging over the classes. If none, returns the result per class.
  iou_range: Tuple[float, float, float], default: (0.5, 0.95, 10)
      The closed range of the iou values (min, max (including), number of points)
class_docstr_tok: ["Abstract","class","to","calculate","average","precision","and","recall","for","various","vision","tasks",".","Parameters","--","--","--","--","--","max_dets",":","Union","[","List","[","int","]",",","Tuple","[","int","]","]",",","default",":","[","1",",","10",",","100","]","Maximum","number","of","detections","per","class",".","area_range",":","tuple",",","default",":","(","32","*","*","2",",","96","*","*","2",")","Slices","for","small\/medium\/large","buckets",".","return_option",":","str",",","default",":","'ap'","ap",":","ap","only",",","ar",":","ar","only",",","None",":","all","(","not","ignite","compliant",")",".","average",":","str",",","default",":","none","The","method","for","averaging","over","the","classes",".","If","none",",","returns","the","result","per","class",".","iou_range",":","Tuple","[","float",",","float",",","float","]",",","default",":","(","0.5",",","0.95",",","10",")","The","closed","range","of","the","iou","values","(","min",",","max","(","including",")",",","number","of","points",")"]
code: def _get_best_matches(
      self, dt, min_iou, ground_truths, ground_truth_to_ignore, ious
  ):
      ground_truth_matched = {}
      detection_matches = {}
  
      for d_idx in range(len(dt)):
          # information about best match so far (best_match=-1 -> unmatched)
          best_iou = min(min_iou, 1 - 1e-10)
          best_match = -1
          for g_idx in range(len(ground_truths)):
              # if this gt already matched, continue
              if g_idx in ground_truth_matched:
                  continue
              # if dt matched and currently on ignore gt, stop
              # this exists to allow for matching ignored ground truth, so that we ignore this detection
              if best_match > -1 and ground_truth_to_ignore[g_idx]:
                  break
  
              if ious[d_idx, g_idx] >= best_iou:
                  best_iou = ious[d_idx, g_idx]
                  best_match = g_idx
          if best_match != -1:
              detection_matches[d_idx] = best_match
              ground_truth_matched[best_match] = d_idx
      return detection_matches
  
imports: import warnings
  from collections import defaultdict
  from typing import List, Optional, Tuple, Union
  import numpy
  from ignite.metrics import Metric
  from ignite.metrics.metric import reinit__is_reduced, sync_all_reduce
  from deepchecks.core.errors import DeepchecksValueError
  from deepchecks.vision.metrics_utils.metric_mixin import MetricMixin, ObjectDetectionMetricMixin
label_desc: Use image node_id 7 for calling the AveragePrecisionRecall obj's underlying member method code with example usage: obj._get_best_matches(dt, min_iou, ground_truths, ground_truth_to_ignore, ious) and returns: detection_matches