class_docstr: set config of preprocess, postprocess and visualize
  Args:
      infer_config (str): path of infer_cfg.yml
class_docstr_tok: ["set","config","of","preprocess",",","postprocess","and","visualize","Args",":","infer_config","(","str",")",":","path","of","infer_cfg.yml"]
code: def __init__(self, infer_config):
      # parsing Yaml config for Preprocess
      with open(infer_config) as f:
          yml_conf = yaml.safe_load(f)
      self.check_model(yml_conf)
      self.arch = yml_conf["arch"]
      self.preprocess_infos = yml_conf["Preprocess"]
      self.min_subgraph_size = yml_conf["min_subgraph_size"]
      self.label_list = yml_conf["label_list"]
      self.use_dynamic_shape = yml_conf["use_dynamic_shape"]
      self.draw_threshold = yml_conf.get("draw_threshold", 0.5)
      self.mask = yml_conf.get("mask", False)
      self.tracker = yml_conf.get("tracker", None)
      self.nms = yml_conf.get("NMS", None)
      self.fpn_stride = yml_conf.get("fpn_stride", None)
      if self.arch == "RCNN" and yml_conf.get("export_onnx", False):
          print(
              "The RCNN export model is used for ONNX and it only supports batch_size = 1"
          )
      self.print_config()
  
imports: import time
  import numpy
  import pycuda.autoinit
  import pycuda.driver
  import tensorrt
  from collections import OrderedDict
  import os
  import yaml
  import json
  import glob
  import argparse
  from preprocess import Compose
  from preprocess import coco_clsid2catid
label_desc: Use image node_id 1 to create a new PredictConfig object from inherited base classes: object with example: obj = PredictConfig(infer_config)