class_docstr: Open Images Challenge dataset for detection.
  
  Args:
      ann_file (str): Open Images Challenge box annotation in txt format.
docstr: Parse image level annotations from csv style ann_file.
  
  Args:
      image_level_ann_file (str): CSV style image level annotation
          file path.
  
  Returns:
      defaultdict[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): of shape 1.
          - `confidence` (float): of shape 1.
docstr_tok: ["Parse","image","level","annotations","from","csv","style","ann_file",".","Args",":","image_level_ann_file","(","str",")",":","CSV","style","image","level","annotation","file","path",".","Returns",":","defaultdict","[","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",")",":","of","shape","1",".","-","`","confidence","`","(","float",")",":","of","shape","1","."]
code: def _parse_img_level_ann(self, image_level_ann_file):
      """Parse image level annotations from csv style ann_file.
  
      Args:
          image_level_ann_file (str): CSV style image level annotation
              file path.
  
      Returns:
          defaultdict[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): of shape 1.
              - `confidence` (float): of shape 1.
      """
  
      item_lists = defaultdict(list)
      with get_local_path(
          image_level_ann_file, backend_args=self.backend_args
      ) as local_path:
          with open(local_path, "r") as f:
              reader = csv.reader(f)
              i = -1
              for line in reader:
                  i += 1
                  if i == 0:
                      continue
                  else:
                      img_id = line[0]
                      label_id = line[1]
                      assert label_id in self.label_id_mapping
                      image_level_label = int(
                          self.label_id_mapping[label_id]
                      )
                      confidence = float(line[2])
                      item_lists[img_id].append(
                          dict(
                              image_level_label=image_level_label,
                              confidence=confidence,
                          )
                      )
      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 OpenImagesChallengeDataset obj's underlying member method code with example usage: obj._parse_img_level_ann(image_level_ann_file) and returns: item_lists