code: def run(FLAGS, cfg):
      ssod_method = cfg.get("ssod_method", None)
      if ssod_method is not None and ssod_method == "ARSL":
          trainer = Trainer_ARSL(cfg, mode="test")
          trainer.load_weights(cfg.weights, ARSL_eval=True)
      # build detector
      else:
          trainer = Trainer(cfg, mode="test")
  
          # load weights
          if cfg.architecture in ["DeepSORT", "ByteTrack"]:
              trainer.load_weights_sde(
                  cfg.det_weights, cfg.reid_weights
              )
          else:
              trainer.load_weights(cfg.weights)
  
      # export model
      trainer.export(FLAGS.output_dir, for_fd=FLAGS.for_fd)
  
      if FLAGS.export_serving_model:
          assert not FLAGS.for_fd
          from paddle_serving_client.io import (
              inference_model_to_serving,
          )
  
          model_name = os.path.splitext(
              os.path.split(cfg.filename)[-1]
          )[0]
  
          inference_model_to_serving(
              dirname="{}/{}".format(FLAGS.output_dir, model_name),
              serving_server="{}/{}/serving_server".format(
                  FLAGS.output_dir, model_name
              ),
              serving_client="{}/{}/serving_client".format(
                  FLAGS.output_dir, model_name
              ),
              model_filename="model.pdmodel",
              params_filename="model.pdiparams",
          )
  
file_path: PaddleDetection/tools/export_model.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import sys
  import warnings
  import paddle
  from ppdet.core.workspace import load_config, merge_config
  from ppdet.utils.check import check_gpu, check_version, check_config
  from ppdet.utils.cli import ArgsParser
  from ppdet.engine import Trainer
  from ppdet.engine.trainer_ssod import Trainer_ARSL
  from ppdet.slim import build_slim_model
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 2 for calling a global function with example usage: run(FLAGS, cfg) without return types