code: def main():
      parser = argparse.ArgumentParser(
          description="Convert keys in pretrained eva "
          "models to mmpretrain style."
      )
      parser.add_argument(
          "--src",
          default="Detic_LbaseI_CLIP_SwinB_896b32_4x_ft4x_max-size.pth",
          help="src model path or url",
      )
      # The dst path must be a full path of the new checkpoint.
      parser.add_argument(
          "--dst",
          default="detic_centernet2_swin-b_fpn_4x_lvis-base_in21k-lvis.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 = {}
      new_state_dict = convert(state_dict)
      if "backbone.fc.weight" in new_state_dict.keys():
          del [new_state_dict["backbone.fc.weight"]]
      if "backbone.fc.bias" in new_state_dict.keys():
          del [new_state_dict["backbone.fc.bias"]]
      weight["state_dict"] = new_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/detic_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