code: def main(args):
      assert args.model_type in [
          "2d",
          "3d",
          "cascade_lowres",
          "cascade_fullres",
      ], "model only support ['2d', '3d', 'cascade_lowres', 'cascade_fullres'], but got {}.".format(
          args.model_type
      )
      assert len(args.model_paths) == len(
          args.param_paths
      ), "The number of pdmodel is not the same with pdiparams. {} != {}.".format(
          len(args.model_paths), len(args.param_paths)
      )
      print("model type: ", args.model_type)
      print("The plan path: ", args.plan_path)
      print("The model paths: ", args.model_paths)
      print(
          "The postprocessing json path: ",
          args.postprocessing_json_path,
      )
  
      if args.model_type in ["3d", "cascade_fullres"]:
          stage = 1
      else:
          stage = 0
  
      predictor = StaticMultiFolderPredictor(
          args.model_paths,
          args.param_paths,
          args.plan_path,
          stage,
          args.min_subgraph_size,
      )
  
      if args.lowres_segmentations is not None:
          assert (
              args.model_type == "cascade_fullres"
          ), "You supply lowres_segmentations dir but the model is not 'cascade_fullres'. Please check model_type."
          print(
              "Cascade lowres segmentation result dir: ",
              args.lowres_segmentations,
          )
  
      predict_from_folder(
          predictor=predictor,
          input_folder=args.image_folder,
          output_folder=args.output_folder,
          save_npz=args.save_npz,
          num_threads_preprocessing=args.num_threads_preprocessing,
          num_threads_nifti_save=args.num_threads_nifti_save,
          lowres_segmentations=args.lowres_segmentations,
          tta=not args.disable_tta,
          mixed_precision=False,
          overwrite_existing=args.overwrite_existing,
          mode="normal",
          step_size=args.step_size,
          plan_path=args.plan_path,
          disable_postprocessing=args.disable_postprocessing,
          postprocessing_json_path=args.postprocessing_json_path,
      )
  
imports: import argparse
  import os
  import sys
  import pickle
  import shutil
  import numpy
  from copy import deepcopy
  from typing import Tuple, List, Union
  import paddle
  from paddle.inference import create_predictor, PrecisionType
  from paddle.inference import Config
  from nnunet.utils.static_predictor import StaticPredictor
  from nnunet.transforms import default_2D_augmentation_params, default_3D_augmentation_params
  from nnunet.predict import predict_from_folder
  from tools.preprocess_utils import GenericPreprocessor, PreprocessorFor2D
label_desc: Use image node_id 2 for calling a global function with example usage: main(args) without return types