class_docstr: object detection and visual grounding dataset.
code: def __init__(
      self,
      *args,
      data_root: str = "",
      label_map_file: Optional[str] = None,
      need_text: bool = True,
      **kwargs,
  ) -> None:
      self.dataset_mode = "VG"
      self.need_text = need_text
      if label_map_file:
          label_map_file = osp.join(data_root, label_map_file)
          with open(label_map_file, "r") as file:
              self.label_map = json.load(file)
          self.dataset_mode = "OD"
      super().__init__(*args, data_root=data_root, **kwargs)
      assert self.return_classes is True
  
file_path: mmdetection/mmdet/datasets/odvg.py
imports: import json
  import os.path
  from typing import List, Optional
  from mmengine.fileio import get_local_path
  from mmdet.registry import DATASETS
  from .base_det_dataset import BaseDetDataset
label_desc: Use image node_id 1 to create a new ODVGDataset object from inherited base classes: BaseDetDataset with example: obj = ODVGDataset()