class_docstr: Open Images dataset for detection.
  
  Args:
      ann_file (str): Annotation file path.
      label_file (str): File path of the label description file that
          maps the classes names in MID format to their short
          descriptions.
      meta_file (str): File path to get image metas.
      hierarchy_file (str): The file path of the class hierarchy.
      image_level_ann_file (str): Human-verified image level annotation,
          which is used in evaluation.
      backend_args (dict, optional): Arguments to instantiate the
          corresponding backend. Defaults to None.
docstr: Parse image level annotations from csv style ann_file.
  
  Args:
      img_level_ann_file (str): CSV style image level annotation
          file path.
  
  Returns:
      Dict[str, List[dict]]: Annotations where item of the defaultdict
      indicates an image, each of which has (n) dicts.
      Keys of dicts are:
  
          - `image_level_label` (int): Label id.
          - `confidence` (float): Labels that are human-verified to be
            present in an image have confidence = 1 (positive labels).
            Labels that are human-verified to be absent from an image
            have confidence = 0 (negative labels). Machine-generated
            labels have fractional confidences, generally >= 0.5.
            The higher the confidence, the smaller the chance for
            the label to be a false positive.
docstr_tok: ["Parse","image","level","annotations","from","csv","style","ann_file",".","Args",":","img_level_ann_file","(","str",")",":","CSV","style","image","level","annotation","file","path",".","Returns",":","Dict","[","str",",","List","[","dict","]","]",":","Annotations","where","item","of","the","defaultdict","indicates","an","image",",","each","of","which","has","(","n",")","dicts",".","Keys","of","dicts","are",":","-","`","image_level_label","`","(","int",")",":","Label","id",".","-","`","confidence","`","(","float",")",":","Labels","that","are","human-verified","to","be","present","in","an","image","have","confidence","=","1","(","positive","labels",")",".","Labels","that","are","human-verified","to","be","absent","from","an","image","have","confidence","=","0","(","negative","labels",")",".","Machine-generated","labels","have","fractional","confidences",",","generally",">","=","0.5",".","The","higher","the","confidence",",","the","smaller","the","chance","for","the","label","to","be","a","false","positive","."]
code: def _parse_img_level_ann(
      self, img_level_ann_file: str
  ) -> Dict[str, List[dict]]:
      """Parse image level annotations from csv style ann_file.
  
      Args:
          img_level_ann_file (str): CSV style image level annotation
              file path.
  
      Returns:
          Dict[str, List[dict]]: Annotations where item of the defaultdict
          indicates an image, each of which has (n) dicts.
          Keys of dicts are:
  
              - `image_level_label` (int): Label id.
              - `confidence` (float): Labels that are human-verified to be
                present in an image have confidence = 1 (positive labels).
                Labels that are human-verified to be absent from an image
                have confidence = 0 (negative labels). Machine-generated
                labels have fractional confidences, generally >= 0.5.
                The higher the confidence, the smaller the chance for
                the label to be a false positive.
      """
  
      item_lists = defaultdict(list)
      with get_local_path(
          img_level_ann_file, backend_args=self.backend_args
      ) as local_path:
          with open(local_path, "r") as f:
              reader = csv.reader(f)
              for i, line in enumerate(reader):
                  if i == 0:
                      continue
                  img_id = line[0]
                  item_lists[img_id].append(
                      dict(
                          image_level_label=int(
                              self.label_id_mapping[line[2]]
                          ),
                          confidence=float(line[3]),
                      )
                  )
      return item_lists
  
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 4 for calling the OpenImagesDataset obj's underlying member method code with example usage: obj._parse_img_level_ann(img_level_ann_file) and returns: item_lists