code: def main():
      parser = argparse.ArgumentParser(
          description="Convert SSL framework RN50 model to Detectron2"
      )
      parser.add_argument(
          "--input_model_file",
          type=str,
          default=None,
          help="Path to input model weights to be converted",
      )
      parser.add_argument(
          "--output_model",
          type=str,
          default=None,
          help="Path to save torch RN-50 model",
      )
      parser.add_argument(
          "--state_dict_key_name",
          type=str,
          default="model_state_dict",
          help="Pytorch model state_dict key name",
      )
      parser.add_argument(
          "--weights_type",
          type=str,
          required=True,
          default="numpy",
          help="numpy | torch",
      )
      args = parser.parse_args()
  
      # load the input model weights
      logger.info("Loading weights...")
      vissl_state_dict = torch.load(args.input_model_file)
      assert (
          args.state_dict_key_name in vissl_state_dict
      ), f"{args.state_dict_key_name} not found"
      vissl_state_dict = vissl_state_dict[args.state_dict_key_name]
      if args.state_dict_key_name == "classy_state_dict":
          vissl_state_dict = vissl_state_dict["base_model"]["model"][
              "trunk"
          ]
  
      renamed_state_dict = _rename_weights_to_d2(
          vissl_state_dict, args.weights_type
      )
      state = {"model": renamed_state_dict, "matching_heuristics": True}
      logger.info(
          "Saving converted weights to: {}".format(args.output_model)
      )
      torch.save(state, args.output_model)
      logger.info("Done!!")
  
file_path: vissl/extra_scripts/convert_vissl_to_detectron2.py
imports: import argparse
  import logging
  import re
  import sys
  from collections import OrderedDict
  import numpy
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: main() without return types