code: def export(args):
      checkpoint = Checkpoint(
          rank=0,
          world_size=1,
          embedding_size=args.embedding_size,
          num_classes=None,
          checkpoint_dir=args.checkpoint_dir,
      )
  
      test_program = paddle.static.Program()
      startup_program = paddle.static.Program()
  
      test_model = StaticModel(
          main_program=test_program,
          startup_program=startup_program,
          backbone_class_name=args.backbone,
          embedding_size=args.embedding_size,
          mode="test",
      )
  
      gpu_id = int(os.getenv("FLAGS_selected_gpus", 0))
      place = paddle.CUDAPlace(gpu_id)
      exe = paddle.static.Executor(place)
      exe.run(startup_program)
  
      checkpoint.load(
          program=test_program, for_train=False, dtype="float32"
      )
      print("Load checkpoint from '{}'.".format(args.checkpoint_dir))
  
      path = os.path.join(args.output_dir, args.backbone)
      if args.export_type == "onnx":
          feed_vars = [test_model.backbone.input_dict["image"].name]
          fetch_vars = [test_model.backbone.output_dict["feature"]]
          export_onnx(
              path, feed_vars, fetch_vars, exe, program=test_program
          )
      else:
          feed_vars = [test_model.backbone.input_dict["image"]]
          fetch_vars = [test_model.backbone.output_dict["feature"]]
          paddle.static.save_inference_model(
              path, feed_vars, fetch_vars, exe, program=test_program
          )
      print("Save exported model to '{}'.".format(args.output_dir))
  
file_path: insightface/recognition/arcface_paddle/static/export.py
imports: import errno
  import os
  import numpy
  import paddle
  from .utils.io import Checkpoint
  from .None import backbones
  from .static_model import StaticModel
label_desc: Use image node_id 2 for calling a global function with example usage: export(args) without return types