class_docstr: set config of preprocess, postprocess and visualize
  Args:
      model_dir (str): root path of model.yml
code: def __init__(self, model_dir, use_fd_format=False):
      # parsing Yaml config for Preprocess
      fd_deploy_file = os.path.join(model_dir, "inference.yml")
      ppdet_deploy_file = os.path.join(model_dir, "infer_cfg.yml")
      if use_fd_format:
          if not os.path.exists(fd_deploy_file) and os.path.exists(
              ppdet_deploy_file
          ):
              raise RuntimeError(
                  "Non-FD format model detected. Please set `use_fd_format` to False."
              )
          deploy_file = fd_deploy_file
      else:
          if not os.path.exists(ppdet_deploy_file) and os.path.exists(
              fd_deploy_file
          ):
              raise RuntimeError(
                  "FD format model detected. Please set `use_fd_format` to False."
              )
          deploy_file = ppdet_deploy_file
      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.labels = yml_conf["label_list"]
      self.mask = False
      self.use_dynamic_shape = yml_conf["use_dynamic_shape"]
      if "mask" in yml_conf:
          self.mask = yml_conf["mask"]
      self.tracker = None
      if "tracker" in yml_conf:
          self.tracker = yml_conf["tracker"]
      if "NMS" in yml_conf:
          self.nms = yml_conf["NMS"]
      if "fpn_stride" in yml_conf:
          self.fpn_stride = yml_conf["fpn_stride"]
      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 os
  import yaml
  import glob
  import json
  from pathlib import Path
  from functools import reduce
  import cv2
  import numpy
  import math
  import paddle
  from paddle.inference import Config
  from paddle.inference import create_predictor
  import sys
  from benchmark_utils import PaddleInferBenchmark
  from picodet_postprocess import PicoDetPostProcess
  from preprocess import preprocess, Resize, NormalizeImage, Permute, PadStride, LetterBoxResize, WarpAffine, Pad, decode_image, CULaneResize
  from keypoint_preprocess import EvalAffine, TopDownEvalAffine, expand_crop
  from clrnet_postprocess import CLRNetPostProcess
  from visualize import visualize_box_mask, imshow_lanes
  from utils import argsparser, Timer, get_current_memory_mb, multiclass_nms, coco_clsid2catid
label_desc: Use image node_id 1 to create a new PredictConfig object  with example: obj = PredictConfig(model_dir, use_fd_format)