class_docstr: Args:
      pred_config (object): config of model, defined by `Config(model_dir)`
      model_dir (str): root path of model.pdiparams, model.pdmodel and infer_cfg.yml
      device (str): Choose the device you want to run, it can be: CPU/GPU/XPU, default is CPU
      run_mode (str): mode of running(paddle/trt_fp32/trt_fp16)
      batch_size (int): size of pre batch in inference
      trt_min_shape (int): min shape for dynamic shape in trt
      trt_max_shape (int): max shape for dynamic shape in trt
      trt_opt_shape (int): opt shape for dynamic shape in trt
      trt_calib_mode (bool): If the model is produced by TRT offline quantitative
          calibration, trt_calib_mode need to set True
      cpu_threads (int): cpu threads
      enable_mkldnn (bool): whether to open MKLDNN
      enable_mkldnn_bfloat16 (bool): whether to turn on mkldnn bfloat16
      output_dir (str): The path of output
      threshold (float): The threshold of score for visualization
      delete_shuffle_pass (bool): whether to remove shuffle_channel_detect_pass in TensorRT.
                                  Used by action model.
class_docstr_tok: ["Args",":","pred_config","(","object",")",":","config","of","model",",","defined","by","`","Config","(","model_dir",")","`","model_dir","(","str",")",":","root","path","of","model.pdiparams",",","model.pdmodel","and","infer_cfg.yml","device","(","str",")",":","Choose","the","device","you","want","to","run",",","it","can","be",":","CPU\/GPU\/XPU",",","default","is","CPU","run_mode","(","str",")",":","mode","of","running","(","paddle\/trt_fp32\/trt_fp16",")","batch_size","(","int",")",":","size","of","pre","batch","in","inference","trt_min_shape","(","int",")",":","min","shape","for","dynamic","shape","in","trt","trt_max_shape","(","int",")",":","max","shape","for","dynamic","shape","in","trt","trt_opt_shape","(","int",")",":","opt","shape","for","dynamic","shape","in","trt","trt_calib_mode","(","bool",")",":","If","the","model","is","produced","by","TRT","offline","quantitative","calibration",",","trt_calib_mode","need","to","set","True","cpu_threads","(","int",")",":","cpu","threads","enable_mkldnn","(","bool",")",":","whether","to","open","MKLDNN","enable_mkldnn_bfloat16","(","bool",")",":","whether","to","turn","on","mkldnn","bfloat16","output_dir","(","str",")",":","The","path","of","output","threshold","(","float",")",":","The","threshold","of","score","for","visualization","delete_shuffle_pass","(","bool",")",":","whether","to","remove","shuffle_channel_detect_pass","in","TensorRT",".","Used","by","action","model","."]
code: def preprocess(self, image_list):
      preprocess_ops = []
      for op_info in self.pred_config.preprocess_infos:
          new_op_info = op_info.copy()
          op_type = new_op_info.pop("type")
          preprocess_ops.append(eval(op_type)(**new_op_info))
  
      input_im_lst = []
      input_im_info_lst = []
      for im_path in image_list:
          im, im_info = preprocess(im_path, preprocess_ops)
          input_im_lst.append(im)
          input_im_info_lst.append(im_info)
      inputs = create_inputs(input_im_lst, input_im_info_lst)
      input_names = self.predictor.get_input_names()
      for i in range(len(input_names)):
          input_tensor = self.predictor.get_input_handle(input_names[i])
          input_tensor.copy_from_cpu(inputs[input_names[i]])
  
      return inputs
  
imports: import glob
  import json
  import math
  import os
  from pathlib import Path
  import cv2
  import numpy
  import yaml
  from paddle.inference import Config
  from paddle.inference import create_predictor
  from .keypoint_preprocess import EvalAffine
  from .keypoint_preprocess import expand_crop
  from .keypoint_preprocess import TopDownEvalAffine
  from .preprocess import decode_image
  from .preprocess import LetterBoxResize
  from .preprocess import NormalizeImage
  from .preprocess import Pad
  from .preprocess import PadStride
  from .preprocess import Permute
  from .preprocess import preprocess
  from .preprocess import Resize
  from .preprocess import WarpAffine
  from .visualize import visualize_box
label_desc: Use image node_id 3 for calling the Detector obj's underlying member method code with example usage: obj.preprocess(image_list) and returns: inputs