class_docstr: set config of preprocess, postprocess and visualize
  Args:
      model_dir (str): root path of infer_cfg.yml
class_docstr_tok: ["set","config","of","preprocess",",","postprocess","and","visualize","Args",":","model_dir","(","str",")",":","root","path","of","infer_cfg.yml"]
code: def __init__(self, model_dir):
      # parsing Yaml config for Preprocess
      deploy_file = os.path.join(model_dir, "infer_cfg.yml")
      with open(deploy_file) 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 copy
  from paddle_serving_server.web_service import WebService, Op
  from paddle_serving_server.proto import general_model_config_pb2
  import google.protobuf.text_format
  import os
  import numpy
  import base64
  from PIL import Image
  import io
  from preprocess_ops import Compose
  from postprocess_ops import HRNetPostProcess
  from argparse import ArgumentParser, RawDescriptionHelpFormatter
  import yaml
label_desc: Use image node_id 1 to create a new PredictConfig object from inherited base classes: object with example: obj = PredictConfig(model_dir)