class_docstr: ReID of SDE methods
  
  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/NPU, default is CPU
      run_mode (str): mode of running(paddle/trt_fp32/trt_fp16)
      batch_size (int): size of per batch in inference, default 50 means at most
          50 sub images can be made a batch and send into ReID model
      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
class_docstr_tok: ["ReID","of","SDE","methods","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\/NPU",",","default","is","CPU","run_mode","(","str",")",":","mode","of","running","(","paddle\/trt_fp32\/trt_fp16",")","batch_size","(","int",")",":","size","of","per","batch","in","inference",",","default","50","means","at","most","50","sub","images","can","be","made","a","batch","and","send","into","ReID","model","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"]
code: def __init__(
      self,
      model_dir,
      device="CPU",
      run_mode="paddle",
      batch_size=50,
      trt_min_shape=1,
      trt_max_shape=1088,
      trt_opt_shape=608,
      trt_calib_mode=False,
      cpu_threads=4,
      enable_mkldnn=False,
  ):
      self.pred_config = self.set_config(model_dir)
      self.predictor, self.config = load_predictor(
          model_dir,
          run_mode=run_mode,
          batch_size=batch_size,
          min_subgraph_size=self.pred_config.min_subgraph_size,
          device=device,
          use_dynamic_shape=self.pred_config.use_dynamic_shape,
          trt_min_shape=trt_min_shape,
          trt_max_shape=trt_max_shape,
          trt_opt_shape=trt_opt_shape,
          trt_calib_mode=trt_calib_mode,
          cpu_threads=cpu_threads,
          enable_mkldnn=enable_mkldnn,
      )
      self.det_times = Timer()
      self.cpu_mem, self.gpu_mem, self.gpu_util = 0, 0, 0
      self.batch_size = batch_size
      self.input_wh = (128, 256)
  
file_path: PaddleDetection/deploy/pipeline/pphuman/reid.py
imports: import os
  import sys
  import cv2
  import numpy
  from python.infer import PredictConfig
  from pptracking.python.det_infer import load_predictor
  from python.utils import Timer
label_desc: Use image node_id 1 to create a new ReID object from inherited base classes: object with example: obj = ReID(model_dir, device, run_mode, batch_size, trt_min_shape, trt_max_shape, trt_opt_shape, trt_calib_mode, cpu_threads, enable_mkldnn)