code: def _preprocess(self, img_path):
      data = {"img": img_path}
      if self.args.resize_width == 0 and self.args.resize_height == 0:
          return self.cfg.transforms(data)["img"]
      else:
          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)
          return transforms(data)["img"]
  
file_path: PaddleSeg/deploy/python/infer_benchmark.py
imports: import argparse
  import codecs
  import os
  import time
  import yaml
  import numpy
  from paddleseg.deploy.infer import DeployConfig
  from paddleseg.utils import logger
  from paddleseg.utils.visualize import get_pseudo_color_map
  from infer import auto_tune, use_auto_tune, Predictor
label_desc: Use image node_id 2 for calling the PredictorBenchmark obj's underlying member method code with example usage: obj._preprocess(img_path) and returns: self, transforms