code: def main():
      parser = argparse.ArgumentParser(
          description="Convert keys to mmdet style."
      )
      parser.add_argument(
          "src",
          default="glip_a_tiny_o365.pth",
          help="src model path or url",
      )
      # The dst path must be a full path of the new checkpoint.
      parser.add_argument(
          "--dst", default="glip_tiny_a_mmdet.pth", help="save path"
      )
      args = parser.parse_args()
  
      checkpoint = CheckpointLoader.load_checkpoint(
          args.src, map_location="cpu"
      )
  
      if "model" in checkpoint:
          state_dict = checkpoint["model"]
      else:
          state_dict = checkpoint
  
      weight = convert(state_dict)
      torch.save(weight, args.dst)
  
      sha = subprocess.check_output(["sha256sum", args.dst]).decode()
      final_file = args.dst.replace(".pth", "") + "-{}.pth".format(
          sha[:8]
      )
      subprocess.Popen(["mv", args.dst, final_file])
      print(f"Done!!, save to {final_file}")
  
file_path: mmdetection/tools/model_converters/glip_to_mmdet.py
imports: import argparse
  import subprocess
  from collections import OrderedDict
  import torch
  from mmengine.runner import CheckpointLoader
label_desc: Use image node_id 4 for calling a global function with example usage: main() without return types