class_docstr: Open Images Challenge dataset for detection.
  
  Args:
      ann_file (str): Open Images Challenge box annotation in txt format.
docstr: Load annotations from an annotation file named as ``self.ann_file``
  
  Returns:
      List[dict]: A list of annotation.
docstr_tok: ["Load","annotations","from","an","annotation","file","named","as","``","self.ann_file","``","Returns",":","List","[","dict","]",":","A","list","of","annotation","."]
code: def load_data_list(self) -> List[dict]:
      """Load annotations from an annotation file named as ``self.ann_file``
  
      Returns:
          List[dict]: A list of annotation.
      """
      classes_names, label_id_mapping = self._parse_label_file(
          self.label_file
      )
      self._metainfo["classes"] = classes_names
      self.label_id_mapping = label_id_mapping
  
      if self.image_level_ann_file is not None:
          img_level_anns = self._parse_img_level_ann(
              self.image_level_ann_file
          )
      else:
          img_level_anns = None
  
      # OpenImagesMetric can get the relation matrix from the dataset meta
      relation_matrix = self._get_relation_matrix(self.hierarchy_file)
      self._metainfo["RELATION_MATRIX"] = relation_matrix
  
      data_list = []
      with get_local_path(
          self.ann_file, backend_args=self.backend_args
      ) as local_path:
          with open(local_path, "r") as f:
              lines = f.readlines()
      i = 0
      while i < len(lines):
          instances = []
          filename = lines[i].rstrip()
          i += 2
          img_gt_size = int(lines[i])
          i += 1
          for j in range(img_gt_size):
              sp = lines[i + j].split()
              instances.append(
                  dict(
                      bbox=[
                          float(sp[1]),
                          float(sp[2]),
                          float(sp[3]),
                          float(sp[4]),
                      ],
                      bbox_label=int(sp[0]) - 1,  # labels begin from 1
                      ignore_flag=0,
                      is_group_ofs=True if int(sp[5]) == 1 else False,
                  )
              )
          i += img_gt_size
          data_list.append(
              dict(
                  img_path=osp.join(self.data_prefix["img"], filename),
                  instances=instances,
              )
          )
  
      # add image metas to data list
      img_metas = load(
          self.meta_file,
          file_format="pkl",
          backend_args=self.backend_args,
      )
      assert len(img_metas) == len(data_list)
      for i, meta in enumerate(img_metas):
          img_id = osp.split(data_list[i]["img_path"])[-1][:-4]
          assert img_id == osp.split(meta["filename"])[-1][:-4]
          h, w = meta["ori_shape"][:2]
          data_list[i]["height"] = h
          data_list[i]["width"] = w
          data_list[i]["img_id"] = img_id
          # denormalize bboxes
          for j in range(len(data_list[i]["instances"])):
              data_list[i]["instances"][j]["bbox"][0] *= w
              data_list[i]["instances"][j]["bbox"][2] *= w
              data_list[i]["instances"][j]["bbox"][1] *= h
              data_list[i]["instances"][j]["bbox"][3] *= h
          # add image-level annotation
          if img_level_anns is not None:
              img_labels = []
              confidences = []
              img_ann_list = img_level_anns.get(img_id, [])
              for ann in img_ann_list:
                  img_labels.append(int(ann["image_level_label"]))
                  confidences.append(float(ann["confidence"]))
              data_list[i]["image_level_labels"] = np.array(
                  img_labels, dtype=np.int64
              )
              data_list[i]["confidences"] = np.array(
                  confidences, dtype=np.float32
              )
      return data_list
  
imports: import csv
  import os.path
  from collections import defaultdict
  from typing import Dict, List, Optional
  import numpy
  from mmengine.fileio import get_local_path, load
  from mmengine.utils import is_abs
  from mmdet.registry import DATASETS
  from .base_det_dataset import BaseDetDataset
label_desc: Use image node_id 2 for calling the OpenImagesChallengeDataset obj's underlying member method code with example usage: obj.load_data_list() and returns: data_list