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
      )
      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
      if args.model_type in ["cascade_fullres", "cascade_fullres"]:
          cascade = True
      else:
          cascade = False
  
      model = NNUNet(
          plan_path=args.plan_path, stage=stage, cascade=cascade
      )
      predictor = MultiFoldsPredictor(model, args.model_paths)
  
      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=args.precision == "fp16",
          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,
      )
  
file_path: PaddleSeg/contrib/MedicalSeg/nnunet/predict.py
imports: import argparse
  import os
  import sys
  import pickle
  import shutil
  import numpy
  from copy import deepcopy
  from medicalseg.models import NNUNet
  from nnunet.utils import predict_cases, MultiFoldsPredictor
label_desc: Use image node_id 4 for calling a global function with example usage: main(args) without return types