code: def main(args):
      env_info = get_sys_env()
      place = (
          "gpu"
          if env_info["Paddle compiled with cuda"]
          and env_info["GPUs used"]
          else "cpu"
      )
  
      paddle.set_device(place)
      if not args.cfg:
          raise RuntimeError("No configuration file specified.")
  
      cfg = Config(args.cfg)
      val_dataset = cfg.val_dataset
      if not val_dataset:
          raise RuntimeError(
              "The verification dataset is not specified in the configuration file."
          )
  
      msg = "\n---------------Config Information---------------\n"
      msg += str(cfg)
      msg += "------------------------------------------------"
      logger.info(msg)
  
      model = cfg.model
      transforms = val_dataset.transforms
      image_list, image_dir = get_image_list(args.image_path)
      logger.info(
          "Number of predict images = {}".format(len(image_list))
      )
  
      predict(
          model,
          model_path=args.model_path,
          transforms=transforms,
          thing_list=val_dataset.thing_list,
          label_divisor=val_dataset.label_divisor,
          stuff_area=val_dataset.stuff_area,
          ignore_index=val_dataset.ignore_index,
          image_list=image_list,
          image_dir=image_dir,
          save_dir=args.save_dir,
          threshold=args.threshold,
          nms_kernel=args.nms_kernel,
          top_k=args.top_k,
      )
  
file_path: PaddleSeg/contrib/PanopticDeepLab/predict.py
imports: import argparse
  import os
  import paddle
  from paddleseg.cvlibs import manager, Config
  from paddleseg.utils import get_sys_env, logger
  from core import predict
  from datasets import CityscapesPanoptic
  from models import PanopticDeepLab
label_desc: Use image node_id 3 for calling a global function with example usage: main(args) without return types