class_docstr: Support MMDET object detection models.
  Refer to https://github.com/open-mmlab/mmdetection
code: def _get_checkpoint_and_config_file(
      self, checkpoint_name: str = None, config_file: str = None
  ):
      from mim.commands import download as mimdownload
  
      from ..utils import download, get_pretrain_configs_dir
  
      logger.debug(f"initializing {checkpoint_name}")
  
      if not checkpoint_name:
          checkpoint_name = self.checkpoint_name
      if not config_file:
          config_file = self.config_file
  
      mmdet_configs_dir = get_pretrain_configs_dir(
          subfolder="detection"
      )
  
      AG_CUSTOM_MODELS = {
          "faster_rcnn_r50_fpn_1x_voc0712": {
              "url": "https://automl-mm-bench.s3.amazonaws.com/voc_script/faster_rcnn_r50_fpn_1x_voc0712_20220320_192712-54bef0f3.pth",
              "config_file": os.path.join(
                  mmdet_configs_dir,
                  "voc",
                  "faster_rcnn_r50_fpn_1x_voc0712.py",
              ),
          },
          "yolox_nano": {
              "url": "https://github.com/Megvii-BaseDetection/YOLOX/releases/download/0.1.1rc0/yolox_nano.pth",
              "config_file": os.path.join(
                  mmdet_configs_dir,
                  "yolox",
                  "yolox_nano_8xb8-300e_coco.py",
              ),
              "source": "MegVii",
          },
          "yolox_tiny": {
              "url": "https://download.openmmlab.com/mmdetection/v2.0/yolox/yolox_tiny_8x8_300e_coco/yolox_tiny_8x8_300e_coco_20211124_171234-b4047906.pth",
              "config_file": os.path.join(
                  mmdet_configs_dir,
                  "yolox",
                  "yolox_tiny_8xb8-300e_coco.py",
              ),
          },
          "yolox_s": {
              "url": "https://download.openmmlab.com/mmdetection/v2.0/yolox/yolox_s_8x8_300e_coco/yolox_s_8x8_300e_coco_20211121_095711-4592a793.pth",
              "config_file": os.path.join(
                  mmdet_configs_dir,
                  "yolox",
                  "yolox_s_8xb8-300e_coco.py",
              ),
          },
          "yolox_m": {
              "url": "https://github.com/Megvii-BaseDetection/YOLOX/releases/download/0.1.1rc0/yolox_m.pth",  # Megvii weight, need more verifications
              "config_file": os.path.join(
                  mmdet_configs_dir,
                  "yolox",
                  "yolox_m_8xb8-300e_coco.py",
              ),
              "source": "MegVii",
          },
          "yolox_l": {
              "url": "https://download.openmmlab.com/mmdetection/v2.0/yolox/yolox_l_8x8_300e_coco/yolox_l_8x8_300e_coco_20211126_140236-d3bd2b23.pth",
              "config_file": os.path.join(
                  mmdet_configs_dir,
                  "yolox",
                  "yolox_l_8xb8-300e_coco.py",
              ),
          },
          "yolox_l_objects365": {  # TODO: update with better pretrained weights
              "url": "https://automl-mm-bench.s3.amazonaws.com/object_detection/checkpoints/yolox/yolox_l_objects365_temp.pth",
              "config_file": os.path.join(
                  mmdet_configs_dir,
                  "yolox",
                  "yolox_l_8xb8-300e_coco.py",
              ),
          },
          "yolox_x": {
              "url": "https://download.openmmlab.com/mmdetection/v2.0/yolox/yolox_x_8x8_300e_coco/yolox_x_8x8_300e_coco_20211126_140254-1ef88d67.pth",
              "config_file": os.path.join(
                  mmdet_configs_dir,
                  "yolox",
                  "yolox_x_8xb8-300e_coco.py",
              ),
          },
          "dino_swinl_tta": {
              "url": "https://github.com/RistoranteRist/mmlab-weights/releases/download/dino-swinl/dino-5scale_swin-l_8xb2-36e_coco-5486e051.pth",
              "config_file": os.path.join(
                  mmdet_configs_dir, "dino", "dino_swinl_tta.py"
              ),
          },
      }
  
      if os.path.isfile(checkpoint_name):
          checkpoint_file = checkpoint_name
      elif os.path.isdir(checkpoint_name):
          checkpoint_file = os.path.join(checkpoint_name, "model.pth")
          config_file = os.path.join(checkpoint_name, "config.py")
      else:
          if checkpoint_name in AG_CUSTOM_MODELS:
              # TODO: add sha1_hash
              checkpoint_file = download(
                  url=AG_CUSTOM_MODELS[checkpoint_name]["url"],
              )
              if (
                  "source" in AG_CUSTOM_MODELS[checkpoint_name]
                  and AG_CUSTOM_MODELS[checkpoint_name]["source"]
                  == "MegVii"
              ):
                  checkpoint_file = self.convert_megvii_yolox(
                      checkpoint_file
                  )
          else:
              # download config and checkpoint files using openmim
              checkpoint_file = mimdownload(
                  package="mmdet",
                  configs=[checkpoint_name],
                  dest_root=".",
              )[0]
  
      if config_file:
          if not os.path.isfile(config_file):
              raise ValueError(
                  f"Invalid checkpoint_name ({checkpoint_name}) or config_file ({config_file}): "
              )
      else:
          if checkpoint_name in AG_CUSTOM_MODELS:
              config_file = AG_CUSTOM_MODELS[checkpoint_name][
                  "config_file"
              ]
          else:
              try:
                  # download config and checkpoint files using openmim
                  mimdownload(
                      package="mmdet",
                      configs=[checkpoint_name],
                      dest_root=".",
                  )
                  config_file = checkpoint_name + ".py"
              except Exception as e:
                  raise ValueError(
                      f"Invalid checkpoint_name ({checkpoint_name}) or config_file ({config_file}): "
                  )
  
      self.checkpoint_name = checkpoint_name
      self.checkpoint_file = checkpoint_file
      self.config_file = config_file
  
imports: import logging
  import os
  import time
  import warnings
  from typing import Optional
  import torch
  from torch import nn
  from ..constants import BBOX, BBOX_FORMATS, COLUMN, IMAGE, IMAGE_VALID_NUM, LABEL, XYXY
  from .utils import freeze_model_layers, lookup_mmdet_config, update_mmdet_config
label_desc: Use image node_id 9 for calling the MMDetAutoModelForObjectDetection obj's underlying member method code with example usage: obj._get_checkpoint_and_config_file(checkpoint_name, config_file) without return types