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 one batch of data samples and predictions. The processed
  results should be stored in ``self.results``, which will be used to
  compute the metrics when all batches have been processed.
  
  Args:
      data_batch (dict): A batch of data from the dataloader.
      data_samples (Sequence[dict]): A batch of data samples that
          contain annotations and predictions.
docstr_tok: ["Process","one","batch","of","data","samples","and","predictions",".","The","processed","results","should","be","stored","in","``","self.results","``",",","which","will","be","used","to","compute","the","metrics","when","all","batches","have","been","processed",".","Args",":","data_batch","(","dict",")",":","A","batch","of","data","from","the","dataloader",".","data_samples","(","Sequence","[","dict","]",")",":","A","batch","of","data","samples","that","contain","annotations","and","predictions","."]
code: def process(
      self, data_batch: dict, data_samples: Sequence[dict]
  ) -> None:
      """Process one batch of data samples and predictions. The processed
      results should be stored in ``self.results``, which will be used to
      compute the metrics when all batches have been processed.
  
      Args:
          data_batch (dict): A batch of data from the dataloader.
          data_samples (Sequence[dict]): A batch of data samples that
              contain annotations and predictions.
      """
      for data_sample in data_samples:
          gt = copy.deepcopy(data_sample)
          # add super-category instances
          # TODO: Need to refactor to support LoadAnnotations
          instances = gt["instances"]
          if self.get_supercategory:
              supercat_instances = self._get_supercategory_ann(
                  instances
              )
              instances.extend(supercat_instances)
          gt_labels = []
          gt_bboxes = []
          is_group_ofs = []
          for ins in instances:
              gt_labels.append(ins["bbox_label"])
              gt_bboxes.append(ins["bbox"])
              is_group_ofs.append(ins["is_group_of"])
          ann = dict(
              labels=np.array(gt_labels, dtype=np.int64),
              bboxes=np.array(gt_bboxes, dtype=np.float32).reshape(
                  (-1, 4)
              ),
              gt_is_group_ofs=np.array(is_group_ofs, dtype=bool),
          )
  
          image_level_labels = gt.get("image_level_labels", None)
          pred = data_sample["pred_instances"]
          pred_bboxes = pred["bboxes"].cpu().numpy()
          pred_scores = pred["scores"].cpu().numpy()
          pred_labels = pred["labels"].cpu().numpy()
  
          (
              pred_bboxes,
              pred_scores,
              pred_labels,
          ) = self._process_predictions(
              pred_bboxes,
              pred_scores,
              pred_labels,
              instances,
              image_level_labels,
          )
  
          dets = []
          for label in range(len(self.dataset_meta["classes"])):
              index = np.where(pred_labels == label)[0]
              pred_bbox_scores = np.hstack(
                  [
                      pred_bboxes[index],
                      pred_scores[index].reshape((-1, 1)),
                  ]
              )
              dets.append(pred_bbox_scores)
          self.results.append((ann, dets))
  
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 4 for calling the OpenImagesMetric obj's underlying member method code with example usage: obj.process(data_batch, data_samples) without return types