code: def main(args):
      with open(args.cfg, "r") as f:
          yaml_conf = yaml.load(f, Loader=yaml.FullLoader)
      model_name = yaml_conf.get("ModelName", None)
      if model_name == "RVM":
          predector_ = PredictorRVM
      else:
          predector_ = Predictor
  
      if args.image_path is not None:
          imgs_list, imgs_dir = get_image_list(args.image_path)
          if args.trimap_path is None:
              trimaps_list = None
          else:
              trimaps_list, _ = get_image_list(args.trimap_path)
  
          if use_auto_tune(args):
              tune_img_nums = 10
              auto_tune(args, imgs_list, tune_img_nums)
  
          predictor = predector_(args)
          predictor.run(
              imgs=imgs_list, trimaps=trimaps_list, imgs_dir=imgs_dir
          )
  
          if use_auto_tune(args) and os.path.exists(
              args.auto_tuned_shape_file
          ):
              os.remove(args.auto_tuned_shape_file)
  
          if args.benchmark:
              predictor.autolog.report()
  
      elif args.video_path is not None:
          predictor = predector_(args)
          predictor.run_video(video_path=args.video_path)
  
      else:
          raise IOError("Please provide --image_path or --video_path.")
  
imports: import argparse
  import codecs
  import os
  import sys
  import cv2
  import tqdm
  import yaml
  import numpy
  import paddle
  from paddle.inference import create_predictor, PrecisionType
  from paddle.inference import Config
  from paddleseg.cvlibs import manager
  from paddleseg.utils import get_sys_env, logger
  import ppmatting.transforms
  from ppmatting.utils import get_image_list, mkdir, estimate_foreground_ml, VideoReader, VideoWriter
label_desc: Use image node_id 4 for calling a global function with example usage: main(args) without return types