code: def main(args=None):
      # parse arguments
      if args is None:
          args = sys.argv[1:]
      args = parse_args(args)
  
      # make sure tensorflow is the minimum required version
      check_tf_version()
  
      # set modified tf session to avoid using the GPUs
      setup_gpu("cpu")
  
      # optionally load config parameters
      anchor_parameters = None
      pyramid_levels = None
      if args.config:
          args.config = read_config_file(args.config)
          if "anchor_parameters" in args.config:
              anchor_parameters = parse_anchor_parameters(args.config)
  
          if "pyramid_levels" in args.config:
              pyramid_levels = parse_pyramid_levels(args.config)
  
      # load the model
      model = models.load_model(
          args.model_in, backbone_name=args.backbone
      )
  
      # check if this is indeed a training model
      models.check_training_model(model)
  
      # convert the model
      model = models.convert_model(
          model,
          nms=args.nms,
          class_specific_filter=args.class_specific_filter,
          anchor_params=anchor_parameters,
          pyramid_levels=pyramid_levels,
          nms_threshold=args.nms_threshold,
          score_threshold=args.score_threshold,
          max_detections=args.max_detections,
          parallel_iterations=args.parallel_iterations,
      )
  
      # save model
      model.save(args.model_out)
  
file_path: ImageAI/imageai_tf_deprecated/Detection/keras_retinanet/bin/convert_model.py
imports: import argparse
  import os
  import sys
  from ..None import models
  from ..utils.config import read_config_file, parse_anchor_parameters, parse_pyramid_levels
  from ..utils.gpu import setup_gpu
  from ..utils.tf_version import check_tf_version
label_desc: Use image node_id 2 for calling a global function with example usage: main(args) without return types