code: def __init__(self, config, mode, logger, seed=None):
      super(PGDataSet, self).__init__()
  
      self.logger = logger
      self.seed = seed
      self.mode = mode
      global_config = config["Global"]
      dataset_config = config[mode]["dataset"]
      loader_config = config[mode]["loader"]
  
      self.delimiter = dataset_config.get("delimiter", "\t")
      label_file_list = dataset_config.pop("label_file_list")
      data_source_num = len(label_file_list)
      ratio_list = dataset_config.get("ratio_list", [1.0])
      if isinstance(ratio_list, (float, int)):
          ratio_list = [float(ratio_list)] * int(data_source_num)
      assert (
          len(ratio_list) == data_source_num
      ), "The length of ratio_list should be the same as the file_list."
      self.data_dir = dataset_config["data_dir"]
      self.do_shuffle = loader_config["shuffle"]
  
      logger.info("Initialize indexs of datasets:%s" % label_file_list)
      self.data_lines = self.get_image_info_list(
          label_file_list, ratio_list
      )
      self.data_idx_order_list = list(range(len(self.data_lines)))
      if mode.lower() == "train":
          self.shuffle_data_random()
  
      self.ops = create_operators(
          dataset_config["transforms"], global_config
      )
  
      self.need_reset = True in [x < 1 for x in ratio_list]
  
file_path: PaddleOCR/ppocr/data/pgnet_dataset.py
imports: import numpy
  import os
  from paddle.io import Dataset
  from .imaug import transform, create_operators
  import random
label_desc: Use image node_id 1 to create a new PGDataSet object from inherited base classes: Dataset with example: obj = PGDataSet(config, mode, logger, seed)