code: def main(args):
      env_info = get_sys_env()
  
      if (
          args.device == "gpu"
          and env_info["Paddle compiled with cuda"]
          and env_info["GPUs used"]
      ):
          place = "gpu"
      elif args.device == "xpu" and paddle.is_compiled_with_xpu():
          place = "xpu"
      elif (
          args.device == "npu"
          and paddle.is_compiled_with_custom_device("npu")
      ):
          place = "npu"
      elif args.device == "mlu" and paddle.is_compiled_with_mlu():
          place = "mlu"
      else:
          place = "cpu"
  
      paddle.set_device(place)
      if not args.cfg:
          raise RuntimeError("No configuration file specified.")
  
      cfg = Config(args.cfg)
  
      msg = "\n---------------Config Information---------------\n"
      msg += str(cfg)
      msg += "------------------------------------------------"
      logger.info(msg)
  
      model = cfg.model
      transforms = Compose(cfg.val_transforms)
      image_list, image_dir = get_image_list(args.image_path)
      logger.info(
          "Number of predict images = {}".format(len(image_list))
      )
  
      test_config = get_test_config(cfg, args)
  
      predict(
          model,
          model_path=args.model_path,
          transforms=transforms,
          image_list=image_list,
          image_dir=image_dir,
          save_dir=args.save_dir,
          **test_config,
      )
  
file_path: PaddleSeg/contrib/RSSegBenchmark/predict.py
imports: import argparse
  import os
  import paddle
  import backbones
  from paddleseg.cvlibs import manager, Config
  from paddleseg.utils import get_sys_env, logger, get_image_list
  from paddleseg.core import predict
  from paddleseg.transforms import Compose
label_desc: Use image node_id 3 for calling a global function with example usage: main(args) without return types