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",")"]
docstr: Get the value of a result by the filtering values.
  
  Parameters
  ----------
  res: np.array
      either precision or recall when using the '2' return option
  iou : float, default: None
      filter by iou threshold
  area : str, default: None
      filter by are range name ['small', 'medium', 'large', 'all']
  max_dets : int, default: None
      filter by max detections
  
  Returns
  -------
  np.array
     The filtered result.
docstr_tok: ["Get","the","value","of","a","result","by","the","filtering","values",".","Parameters","--","--","--","--","--","res",":","np.array","either","precision","or","recall","when","using","the","'","2","'","return","option","iou",":","float",",","default",":","None","filter","by","iou","threshold","area",":","str",",","default",":","None","filter","by","are","range","name","[","'small","'",",","'medium","'",",","'large","'",",","'all","'","]","max_dets",":","int",",","default",":","None","filter","by","max","detections","Returns","--","--","--","-","np.array","The","filtered","result","."]
code: def filter_res(
      self,
      res: np.ndarray,
      iou: float = None,
      area: str = None,
      max_dets: int = None,
  ):
      """Get the value of a result by the filtering values.
  
      Parameters
      ----------
      res: np.array
          either precision or recall when using the '2' return option
      iou : float, default: None
          filter by iou threshold
      area : str, default: None
          filter by are range name ['small', 'medium', 'large', 'all']
      max_dets : int, default: None
          filter by max detections
  
      Returns
      -------
      np.array
         The filtered result.
      """
      if iou:
          iou_i = [
              i
              for i, iou_thres in enumerate(self.iou_thresholds)
              if iou == iou_thres
          ]
          res = res[iou_i, :, :, :]
      if area:
          area_i = [
              i
              for i, area_name in enumerate(self.area_ranges_names)
              if area == area_name
          ]
          res = res[:, area_i, :, :]
      if max_dets:
          dets_i = [
              i
              for i, det in enumerate(self.max_detections_per_class)
              if max_dets == det
          ]
          res = res[:, :, dets_i, :]
      return res
  
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 10 for calling the AveragePrecisionRecall obj's underlying member method code with example usage: obj.filter_res(res, iou, area, max_dets) and returns: res