class_docstr: step 1：paddle.io.Dataset
docstr: step 2：create reader
docstr_tok: ["step","2\uff1acreate","reader"]
code: def __init__(self, transforms: Callable, mode: str = "train"):
      """
      step 2：create reader
      """
      super(GemStones, self).__init__()
  
      self.mode = mode
      self.transforms = transforms
  
      train_image_dir = config_parameters["train_image_dir"]
      eval_image_dir = config_parameters["eval_image_dir"]
      test_image_dir = config_parameters["test_image_dir"]
  
      train_data_folder = paddle.vision.DatasetFolder(train_image_dir)
      eval_data_folder = paddle.vision.DatasetFolder(eval_image_dir)
      test_data_folder = paddle.vision.DatasetFolder(test_image_dir)
  
      config_parameters["label_dict"] = train_data_folder.class_to_idx
  
      if self.mode == "train":
          self.data = train_data_folder
      elif self.mode == "eval":
          self.data = eval_data_folder
      elif self.mode == "test":
          self.data = test_data_folder
  
file_path: PaddleHub/modules/image/classification/SpinalNet_Gemstones/gem_dataset.py
imports: import paddle
  import numpy
  from typing import Callable
  from code.config import config_parameters
label_desc: Use image node_id 1 to create a new GemStones object from inherited base classes: paddle.io with example: obj = GemStones(transforms, mode)