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
      cfg_hard = Config(args.cfg_hard)
  
      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
      model_hard = cfg_hard.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))
      )
      predictEnsemble(
          model,
          model_hard,
          model_path=args.model_path,
          model_path_hard=args.model_path_hard,
          transforms=transforms,
          image_list=image_list,
          image_dir=image_dir,
          save_dir=args.save_dir,
          aug_pred=args.aug_pred,
          scales=args.scales,
          flip_horizontal=args.flip_horizontal,
          flip_vertical=args.flip_vertical,
          is_slide=args.is_slide,
          crop_size=args.crop_size,
          stride=args.stride,
      )
  
file_path: PaddleSeg/contrib/AutoNUE/predict_ensemble.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 predictEnsemble
  import datasets, models
label_desc: Use image node_id 3 for calling a global function with example usage: main(args) without return types