code: def get_config_pretrained_url_mapping() -> Dict[str, str]:
      """
      Walks the MMDETECTION_CONFIG_DIR and creates a mapping of configs
      to urls for pretrained checkpoints. The url for pretrained checkpoints
      are parsed from the README files in each of the mmdetection config folders.
  
      MMDETECTION_CONFIG_DIR is set to /mmdetection/configs in the default
      determinedai/model-hub-mmdetection docker image.
      """
      models = {}
      config_dir = os.getenv("MMDETECTION_CONFIG_DIR")
      if config_dir:
          for root, _, files in os.walk(config_dir):
              for f in files:
                  if "README" in f:
                      with open(os.path.join(root, f), "r") as readme:
                          lines = readme.readlines()
                          for line in lines:
                              if "[config]" in line:
                                  start = line.find("[config]")
                                  end = line.find(".py", start)
                                  start = line.rfind("/", start, end)
                                  config_name = line[
                                      start + 1 : end + 3
                                  ]
                                  start = line.find("[model]")
                                  end = line.find(".pth", start)
                                  ckpt_name = line[start + 8 : end + 4]
                                  models[config_name] = ckpt_name
      return models
  
file_path: determined/model_hub/model_hub/mmdetection/utils.py
imports: import os
  from typing import Any, Dict, Tuple
  import mmcv
  import torch
  import model_hub.utils
label_desc: Use image node_id 1 for calling a global function with example usage: get_config_pretrained_url_mapping() and returns: models