class_docstr: RefCOCO dataset.
  
  The `Refcoco` and `Refcoco+` dataset is based on
  `ReferItGame: Referring to Objects in Photographs of Natural Scenes
  <http://tamaraberg.com/papers/referit.pdf>`_.
  
  The `Refcocog` dataset is based on
  `Generation and Comprehension of Unambiguous Object Descriptions
  <https://arxiv.org/abs/1511.02283>`_.
  
  Args:
      ann_file (str): Annotation file path.
      data_root (str): The root directory for ``data_prefix`` and
          ``ann_file``. Defaults to ''.
      data_prefix (str): Prefix for training data.
      split_file (str): Split file path.
      split (str): Split name. Defaults to 'train'.
      text_mode (str): Text mode. Defaults to 'random'.
      **kwargs: Other keyword arguments in :class:`BaseDataset`.
class_docstr_tok: ["RefCOCO","dataset",".","The","`","Refcoco","`","and","`","Refcoco+","`","dataset","is","based","on","`","ReferItGame",":","Referring","to","Objects","in","Photographs","of","Natural","Scenes","<","http",":","\/\/tamaraberg.com\/papers\/referit.pdf",">","`","_",".","The","`","Refcocog","`","dataset","is","based","on","`","Generation","and","Comprehension","of","Unambiguous","Object","Descriptions","<","https",":","\/\/arxiv.org\/abs\/1511.02283",">","`","_",".","Args",":","ann_file","(","str",")",":","Annotation","file","path",".","data_root","(","str",")",":","The","root","directory","for","``","data_prefix","``","and","``","ann_file","``",".","Defaults","to","``",".","data_prefix","(","str",")",":","Prefix","for","training","data",".","split_file","(","str",")",":","Split","file","path",".","split","(","str",")",":","Split","name",".","Defaults","to","'train","'",".","text_mode","(","str",")",":","Text","mode",".","Defaults","to","'random","'",".","*","*","kwargs",":","Other","keyword","arguments","in",":","class",":","`","BaseDataset","`","."]
code: def __init__(
      self,
      data_root: str,
      ann_file: str,
      split_file: str,
      data_prefix: Dict,
      split: str = "train",
      text_mode: str = "random",
      **kwargs,
  ):
      self.split_file = split_file
      self.split = split
  
      assert text_mode in [
          "original",
          "random",
          "concat",
          "select_first",
      ]
      self.text_mode = text_mode
      super().__init__(
          data_root=data_root,
          data_prefix=data_prefix,
          ann_file=ann_file,
          **kwargs,
      )
  
file_path: mmdetection/mmdet/datasets/refcoco.py
imports: import collections
  import os.path
  import random
  from typing import Dict, List
  import mmengine
  from mmengine.dataset import BaseDataset
  from mmdet.registry import DATASETS
label_desc: Use image node_id 1 to create a new RefCocoDataset object from inherited base classes: BaseDataset with example: obj = RefCocoDataset(data_root, ann_file, split_file, data_prefix, split, text_mode)