code: def main(args: argparse.Namespace) -> None:
      print("Loading model...")
  
      sam = sam_model_registry[args.model_type](
          checkpoint=model_link[args.model_type]
      )
      if paddle.is_compiled_with_cuda():
          paddle.set_device("gpu")
      else:
          paddle.set_device("cpu")
      output_mode = "coco_rle" if args.convert_to_rle else "binary_mask"
      amg_kwargs = get_amg_kwargs(args)
      generator = SamAutomaticMaskGenerator(
          sam, output_mode=output_mode, **amg_kwargs
      )
  
      gradio_display(generator)
  
file_path: PaddleSeg/contrib/SegmentAnything/scripts/amg_paddle.py
imports: import os
  import sys
  import time
  import cv2
  import argparse
  import numpy
  import paddle
  from segment_anything import SamAutomaticMaskGenerator, sam_model_registry
  from paddleseg.utils.visualize import get_pseudo_color_map, get_color_map_list
label_desc: Use image node_id 7 for calling a global function with example usage: main(args) without return types