code: def get_dataset(args):
      comp = manager.DATASETS
      if args.dataset_type not in comp.components_dict:
          raise RuntimeError("The dataset is not supported.")
  
      cfg = DeployConfig(args.cfg)
  
      if args.resize_width == 0 and args.resize_height == 0:
          transforms = cfg.transforms.transforms
      else:
          # load and add resize to transforms
          assert args.resize_width > 0 and args.resize_height > 0
          with codecs.open(args.cfg, "r", "utf-8") as file:
              dic = yaml.load(file, Loader=yaml.FullLoader)
          transforms_dic = dic["Deploy"]["transforms"]
          transforms_dic.insert(
              0,
              {
                  "type": "Resize",
                  "target_size": [
                      args.resize_width,
                      args.resize_height,
                  ],
              },
          )
          transforms = DeployConfig.load_transforms(
              transforms_dic
          ).transforms
  
      kwargs = {
          "transforms": transforms,
          "dataset_root": args.dataset_path,
          "mode": args.dataset_mode,
      }
      dataset = comp[args.dataset_type](**kwargs)
      return dataset
  
imports: import argparse
  import codecs
  import os
  import time
  import yaml
  import numpy
  import paddle
  import paddle.nn.functional
  from paddle.inference import create_predictor
  from paddle.inference import Config
  from paddleseg.deploy.infer import DeployConfig
  from paddleseg.cvlibs import manager
  from paddleseg.utils import logger, metrics, progbar
  from infer import auto_tune, use_auto_tune, Predictor
label_desc: Use image node_id 2 for calling a global function with example usage: get_dataset(args) and returns: dataset