docstr: load img and transform it
  Args:
  Img(str): A batch of image path
code: def _preprocess(self, img):
      """load img and transform it
      Args:
      Img(str): A batch of image path
      """
      if not "npy" in img:
          image_files = get_image_list(img, None, None)
          warnings.warn(
              "The image path is {}, please make sure this is the images you want to infer".format(
                  image_files
              )
          )
          savepath = os.path.dirname(img)
          pre = [
              HUnorm,
              functools.partial(
                  resample,  # TODO: config preprocess in deply.yaml(export) to set params
                  new_shape=[128, 128, 128],
                  order=1,
              ),
          ]
  
          for f in image_files:
              f_nps = Prep.load_medical_data(f)
              for f_np in f_nps:
                  if pre is not None:
                      for op in pre:
                          f_np = op(f_np)
  
                  # Set image to a uniform format before save.
                  if isinstance(f_np, tuple):
                      f_np = f_np[0]
                  f_np = f_np.astype("float32")
  
                  np.save(
                      os.path.join(
                          savepath,
                          f.split("/")[-1].split(".", maxsplit=1)[0],
                      ),
                      f_np,
                  )
  
          img = img.split(".", maxsplit=1)[0] + ".npy"
      return self.cfg.transforms(img)[0]
  
imports: import os
  import sys
  import codecs
  import warnings
  import argparse
  import yaml
  import functools
  import numpy
  from paddle.inference import create_predictor, PrecisionType
  from paddle.inference import Config
  import paddle
  import medicalseg.transforms
  from medicalseg.cvlibs import manager
  from medicalseg.utils import get_sys_env, logger, get_image_list
  from medicalseg.utils.visualize import get_pseudo_color_map
  from medicalseg.core.infer import sliding_window_inference
  from tools import HUnorm, resample
  from tools import Prep
label_desc: Use image node_id 6 for calling the Predictor obj's underlying member method code with example usage: obj._preprocess(img) and returns: self