class_docstr: Pass in a custom dataset that conforms to the format.
  
  Args:
      mode (str, optional): which part of dataset to use. it is one of ('train', 'val', 'test'). Default: 'train'.
      transforms (list): Transforms for image.
      dataset_root (str): The dataset directory.
      train_path (str, optional): The train dataset file. When mode is 'train', train_path is necessary.
          The contents of train_path file are as follow:
          image1.jpg ground_truth1.png
          image2.jpg ground_truth2.png
      val_path (str, optional): The evaluation dataset file. When mode is 'val', val_path is necessary.
          The contents is the same as train_path
      file_length (int, optional): The number of trainable data in the dataset. Default: None.
      ignore_index (int, optional): The category that needs to be ignored during the training process.
      separator (str, optional): The separator of dataset list.
code: def __getitem__(self, index):
      if self._file_length is not None:
          names = self._construct_new_file_names(self._file_length)[
              index
          ]
      else:
          names = self._file_names[index]
      image_path = os.path.join(self.dataset_root, names[0])
      label_path = os.path.join(self.dataset_root, names[1])
      data = {}
      data["trans_info"] = []
      data["img"] = image_path
      data["label"] = label_path
      # If key in gt_fields, the data[key] have transforms synchronous.
      data["gt_fields"] = []
      if self.mode == "val":
          data = self.transforms(data)
          data["label"] = data["label"][np.newaxis, :, :]
  
      else:
          data["gt_fields"].append("label")
          data = self.transforms(data)
  
      return data
  
file_path: PaddleSeg/contrib/CrossPseudoSupervision/datasets/basedataset.py
imports: import os
  import paddle
  import numpy
  from paddle.io import Dataset
  from paddleseg.transforms import Compose
label_desc: Use image node_id 3 for calling the BaseDataset obj's underlying member method code with example usage: obj.__getitem__(index) and returns: data