class_docstr: Args:
      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 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
      type_threshold (float): The threshold of score for vehicle type recognition.
      color_threshold (float): The threshold of score for vehicle color recognition.
class_docstr_tok: ["Args",":","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","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","type_threshold","(","float",")",":","The","threshold","of","score","for","vehicle","type","recognition",".","color_threshold","(","float",")",":","The","threshold","of","score","for","vehicle","color","recognition","."]
code: def __init__(
      self,
      model_dir,
      device="CPU",
      run_mode="paddle",
      batch_size=1,
      trt_min_shape=1,
      trt_max_shape=1280,
      trt_opt_shape=640,
      trt_calib_mode=False,
      cpu_threads=1,
      enable_mkldnn=False,
      output_dir="output",
      color_threshold=0.5,
      type_threshold=0.5,
  ):
      super(VehicleAttr, self).__init__(
          model_dir=model_dir,
          device=device,
          run_mode=run_mode,
          batch_size=batch_size,
          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,
          output_dir=output_dir,
      )
      self.color_threshold = color_threshold
      self.type_threshold = type_threshold
      self.result_history = {}
      self.color_list = [
          "yellow",
          "orange",
          "green",
          "gray",
          "red",
          "blue",
          "white",
          "golden",
          "brown",
          "black",
      ]
      self.type_list = [
          "sedan",
          "suv",
          "van",
          "hatchback",
          "mpv",
          "pickup",
          "bus",
          "truck",
          "estate",
      ]
  
file_path: PaddleDetection/deploy/pipeline/ppvehicle/vehicle_attr.py
imports: import os
  import yaml
  import glob
  import cv2
  import numpy
  import math
  import paddle
  import sys
  from paddle.inference import Config, create_predictor
  from python.utils import argsparser, Timer, get_current_memory_mb
  from python.benchmark_utils import PaddleInferBenchmark
  from python.infer import Detector, print_arguments
  from pipeline.pphuman.attr_infer import AttrDetector
label_desc: Use image node_id 1 to create a new VehicleAttr object from inherited base classes: AttrDetector with example: obj = VehicleAttr(model_dir, device, run_mode, batch_size, trt_min_shape, trt_max_shape, trt_opt_shape, trt_calib_mode, cpu_threads, enable_mkldnn, output_dir, color_threshold, type_threshold)