class_docstr: Support MMDET object detection models.
  Refer to https://github.com/open-mmlab/mmdetection
docstr: Load a pretrained object detector from MMdetection.
  
  Parameters
  ----------
  prefix
      The prefix of the MMdetAutoModelForObjectDetection model.
  checkpoint_name
      Name of the mmdet checkpoint.
  classes
      All classes in this dataset.
  pretrained
      Whether using the pretrained mmdet models. If pretrained=True, download the pretrained model.
docstr_tok: ["Load","a","pretrained","object","detector","from","MMdetection",".","Parameters","--","--","--","--","--","prefix","The","prefix","of","the","MMdetAutoModelForObjectDetection","model",".","checkpoint_name","Name","of","the","mmdet","checkpoint",".","classes","All","classes","in","this","dataset",".","pretrained","Whether","using","the","pretrained","mmdet","models",".","If","pretrained=True",",","download","the","pretrained","model","."]
code: def __init__(
      self,
      prefix: str,
      checkpoint_name: str,
      config_file: Optional[str] = None,
      classes: Optional[list] = None,
      pretrained: Optional[bool] = True,
      output_bbox_format: Optional[str] = XYXY,
      frozen_layers: Optional[list] = None,
  ):
      """
      Load a pretrained object detector from MMdetection.
  
      Parameters
      ----------
      prefix
          The prefix of the MMdetAutoModelForObjectDetection model.
      checkpoint_name
          Name of the mmdet checkpoint.
      classes
          All classes in this dataset.
      pretrained
          Whether using the pretrained mmdet models. If pretrained=True, download the pretrained model.
      """
      from ..utils import check_if_packages_installed
  
      check_if_packages_installed(
          package_names=["mmcv", "mmengine", "mmdet"]
      )
  
      super().__init__()
      self.prefix = prefix
      self.pretrained = pretrained
      self.checkpoint = None
      self.checkpoint_name = checkpoint_name
      self.config_file = config_file
      self.classes = classes
      self.frozen_layers = frozen_layers
  
      self.device = None
  
      if output_bbox_format.lower() in BBOX_FORMATS:
          self.output_bbox_format = output_bbox_format.lower()
      else:
          raise ValueError(
              f"Not supported bounding box output format for object detection: {output_bbox_format}. All supported bounding box output formats are: {BBOX_FORMATS}."
          )
  
      # TODO: Config only init (without checkpoint)
  
      self._get_checkpoint_and_config_file(
          checkpoint_name=checkpoint_name, config_file=config_file
      )
      self._load_config()
  
      self._update_classes(classes)
      self._load_checkpoint(self.checkpoint_file)
  
      freeze_model_layers(self.model, self.frozen_layers)
  
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 1 to create a new MMDetAutoModelForObjectDetection object from inherited base classes: nn with example: obj = MMDetAutoModelForObjectDetection(prefix, checkpoint_name, config_file, classes, pretrained, output_bbox_format, frozen_layers)