code: def convert_to_detectron2_names(layer_keys):
      output_keys = []
      for k in layer_keys:
          k = k.replace("_feature_blocks.conv1.", "stem.conv1.")
          k = k.replace("_feature_blocks.bn1.", "stem.conv1.norm.")
          k = k.replace("_feature_blocks.layer1.", "res2.")
          k = k.replace("_feature_blocks.layer2.", "res3.")
          k = k.replace("_feature_blocks.layer3.", "res4.")
          k = k.replace("_feature_blocks.layer4.", "res5.")
  
          k = k.replace(".downsample.0.", ".shortcut.")
          k = k.replace(".downsample.1.", ".shortcut.norm.")
          k = k.replace(".bn1.", ".conv1.bn.")
          k = k.replace(".bn2.", ".conv2.bn.")
          k = k.replace(".bn3.", ".conv3.bn.")
          k = re.sub("bn\\.bias$", "norm.bias", k)
          k = re.sub("bn\\.weight$", "norm.weight", k)
          k = re.sub("bn\\.running_mean$", "norm.running_mean", k)
          k = re.sub("bn\\.running_var$", "norm.running_var", k)
          output_keys.append(k)
  
      assert len(output_keys) == len(
          set(output_keys)
      ), "Error in converting layer names"
      return output_keys
  
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 1 for calling a global function with example usage: convert_to_detectron2_names(layer_keys) and returns: output_keys