code: def main(args):
      assert (
          args.cfg is not None
      ), "No configuration file specified, please set --config"
      cfg = Config(args.cfg)
      builder = MatBuilder(cfg)
  
      paddleseg.utils.show_env_info()
      paddleseg.utils.show_cfg_info(cfg)
      paddleseg.utils.set_device(args.device)
  
      model = builder.model
      transforms = ppmatting.transforms.Compose(builder.val_transforms)
  
      image_list, image_dir = get_image_list(args.image_path)
      if args.trimap_path is None:
          trimap_list = None
      else:
          trimap_list, _ = get_image_list(args.trimap_path)
      logger.info(
          "Number of predict images = {}".format(len(image_list))
      )
  
      predict(
          model,
          model_path=args.model_path,
          transforms=transforms,
          image_list=image_list,
          image_dir=image_dir,
          trimap_list=trimap_list,
          save_dir=args.save_dir,
          fg_estimate=args.fg_estimate,
      )
  
file_path: PaddleSeg/Matting/tools/predict.py
imports: import argparse
  import os
  import sys
  import paddle
  import paddleseg
  from paddleseg.cvlibs import manager
  from paddleseg.utils import get_sys_env, logger
  import ppmatting
  from ppmatting.core import predict
  from ppmatting.utils import get_image_list, Config, MatBuilder
label_desc: Use image node_id 2 for calling a global function with example usage: main(args) without return types