class_docstr: OpenImages evaluation metric.
  
  Evaluate detection mAP for OpenImages. Please refer to
  https://storage.googleapis.com/openimages/web/evaluation.html for more
  details.
  
  Args:
      iou_thrs (float or List[float]): IoU threshold. Defaults to 0.5.
      ioa_thrs (float or List[float]): IoA threshold. Defaults to 0.5.
      scale_ranges (List[tuple], optional): Scale ranges for evaluating
          mAP. If not specified, all bounding boxes would be included in
          evaluation. Defaults to None
      use_group_of (bool): Whether consider group of groud truth bboxes
          during evaluating. Defaults to True.
      get_supercategory (bool): Whether to get parent class of the
          current class. Default: True.
      filter_labels (bool): Whether filter unannotated classes.
          Default: True.
      collect_device (str): Device name used for collecting results from
          different ranks during distributed training. Must be 'cpu' or
          'gpu'. Defaults to 'cpu'.
      prefix (str, optional): The prefix that will be added in the metric
          names to disambiguate homonymous metrics of different evaluators.
          If prefix is not provided in the argument, self.default_prefix
          will be used instead. Defaults to None.
class_docstr_tok: ["OpenImages","evaluation","metric",".","Evaluate","detection","mAP","for","OpenImages",".","Please","refer","to","https",":","\/\/storage.googleapis.com\/openimages\/web\/evaluation.html","for","more","details",".","Args",":","iou_thrs","(","float","or","List","[","float","]",")",":","IoU","threshold",".","Defaults","to","0.5.","ioa_thrs","(","float","or","List","[","float","]",")",":","IoA","threshold",".","Defaults","to","0.5.","scale_ranges","(","List","[","tuple","]",",","optional",")",":","Scale","ranges","for","evaluating","mAP",".","If","not","specified",",","all","bounding","boxes","would","be","included","in","evaluation",".","Defaults","to","None","use_group_of","(","bool",")",":","Whether","consider","group","of","groud","truth","bboxes","during","evaluating",".","Defaults","to","True",".","get_supercategory","(","bool",")",":","Whether","to","get","parent","class","of","the","current","class",".","Default",":","True",".","filter_labels","(","bool",")",":","Whether","filter","unannotated","classes",".","Default",":","True",".","collect_device","(","str",")",":","Device","name","used","for","collecting","results","from","different","ranks","during","distributed","training",".","Must","be","'cpu","'","or","'gpu","'",".","Defaults","to","'cpu","'",".","prefix","(","str",",","optional",")",":","The","prefix","that","will","be","added","in","the","metric","names","to","disambiguate","homonymous","metrics","of","different","evaluators",".","If","prefix","is","not","provided","in","the","argument",",","self.default_prefix","will","be","used","instead",".","Defaults","to","None","."]
docstr: Process results of the corresponding class of the detection bboxes.
  
  Note: It will choose to do the following two processing according to
  the parameters:
  
  1. Whether to add parent classes of the corresponding class of the
  detection bboxes.
  
  2. Whether to ignore the classes that unannotated on that image.
  
  Args:
      pred_bboxes (np.ndarray): bboxes predicted by the model
      pred_scores (np.ndarray): scores predicted by the model
      pred_labels (np.ndarray): labels predicted by the model
      gt_instances (list): ground truth annotations
      image_level_labels (np.ndarray): human-verified image level labels
  
  Returns:
      tuple: Processed bboxes, scores, and labels.
docstr_tok: ["Process","results","of","the","corresponding","class","of","the","detection","bboxes",".","Note",":","It","will","choose","to","do","the","following","two","processing","according","to","the","parameters",":","1",".","Whether","to","add","parent","classes","of","the","corresponding","class","of","the","detection","bboxes",".","2",".","Whether","to","ignore","the","classes","that","unannotated","on","that","image",".","Args",":","pred_bboxes","(","np.ndarray",")",":","bboxes","predicted","by","the","model","pred_scores","(","np.ndarray",")",":","scores","predicted","by","the","model","pred_labels","(","np.ndarray",")",":","labels","predicted","by","the","model","gt_instances","(","list",")",":","ground","truth","annotations","image_level_labels","(","np.ndarray",")",":","human-verified","image","level","labels","Returns",":","tuple",":","Processed","bboxes",",","scores",",","and","labels","."]
code: def _process_predictions(
      self,
      pred_bboxes: np.ndarray,
      pred_scores: np.ndarray,
      pred_labels: np.ndarray,
      gt_instances: list,
      image_level_labels: np.ndarray,
  ) -> tuple:
      """Process results of the corresponding class of the detection bboxes.
  
      Note: It will choose to do the following two processing according to
      the parameters:
  
      1. Whether to add parent classes of the corresponding class of the
      detection bboxes.
  
      2. Whether to ignore the classes that unannotated on that image.
  
      Args:
          pred_bboxes (np.ndarray): bboxes predicted by the model
          pred_scores (np.ndarray): scores predicted by the model
          pred_labels (np.ndarray): labels predicted by the model
          gt_instances (list): ground truth annotations
          image_level_labels (np.ndarray): human-verified image level labels
  
      Returns:
          tuple: Processed bboxes, scores, and labels.
      """
      processed_bboxes = copy.deepcopy(pred_bboxes)
      processed_scores = copy.deepcopy(pred_scores)
      processed_labels = copy.deepcopy(pred_labels)
      gt_labels = np.array(
          [ins["bbox_label"] for ins in gt_instances], dtype=np.int64
      )
      if image_level_labels is not None:
          allowed_classes = np.unique(
              np.append(gt_labels, image_level_labels)
          )
      else:
          allowed_classes = np.unique(gt_labels)
      relation_matrix = self.dataset_meta["RELATION_MATRIX"]
      pred_classes = np.unique(pred_labels)
      for pred_class in pred_classes:
          classes = np.where(relation_matrix[pred_class])[0]
          for cls in classes:
              if (
                  cls in allowed_classes
                  and cls != pred_class
                  and self.get_supercategory
              ):
                  # add super-supercategory preds
                  index = np.where(pred_labels == pred_class)[0]
                  processed_scores = np.concatenate(
                      [processed_scores, pred_scores[index]]
                  )
                  processed_bboxes = np.concatenate(
                      [processed_bboxes, pred_bboxes[index]]
                  )
                  extend_labels = np.full(
                      index.shape, cls, dtype=np.int64
                  )
                  processed_labels = np.concatenate(
                      [processed_labels, extend_labels]
                  )
              elif cls not in allowed_classes and self.filter_labels:
                  # remove unannotated preds
                  index = np.where(processed_labels != cls)[0]
                  processed_scores = processed_scores[index]
                  processed_bboxes = processed_bboxes[index]
                  processed_labels = processed_labels[index]
      return processed_bboxes, processed_scores, processed_labels
  
file_path: mmdetection/mmdet/evaluation/metrics/openimages_metric.py
imports: import copy
  from collections import OrderedDict
  from typing import List, Optional, Sequence, Union
  import numpy
  from mmengine.evaluator import BaseMetric
  from mmengine.logging import MMLogger, print_log
  from mmdet.registry import METRICS
  from ..functional import eval_map
label_desc: Use image node_id 3 for calling the OpenImagesMetric obj's underlying member method code with example usage: obj._process_predictions(pred_bboxes, pred_scores, pred_labels, gt_instances, image_level_labels) and returns: processed_bboxes,  processed_scores,  processed_labels