class_docstr: Support MMDET object detection models.
  Refer to https://github.com/open-mmlab/mmdetection
docstr: Assign an id to each layer. Layer ids will be used in layer-wise lr decay.
  Basically, id gradually increases when going from the output end to
  the input end. The layers defined in this class, e.g., head, have id 0.
  
  Setting all layers as the same id 0 for now.
  TODO: Need to investigate mmdetection's model definitions
  Currently only head to 0 others to 1.
  
  Returns
  -------
  A dictionary mapping the layer names (keys) to their ids (values).
docstr_tok: ["Assign","an","id","to","each","layer",".","Layer","ids","will","be","used","in","layer-wise","lr","decay",".","Basically",",","id","gradually","increases","when","going","from","the","output","end","to","the","input","end",".","The","layers","defined","in","this","class",",","e.g.",",","head",",","have","id","0",".","Setting","all","layers","as","the","same","id","0","for","now",".","TODO",":","Need","to","investigate","mmdetection","'s","model","definitions","Currently","only","head","to","0","others","to","1",".","Returns","--","--","--","-","A","dictionary","mapping","the","layer","names","(","keys",")","to","their","ids","(","values",")","."]
code: def get_layer_ids(
      self,
  ):
      """
      Assign an id to each layer. Layer ids will be used in layer-wise lr decay.
      Basically, id gradually increases when going from the output end to
      the input end. The layers defined in this class, e.g., head, have id 0.
  
      Setting all layers as the same id 0 for now.
      TODO: Need to investigate mmdetection's model definitions
      Currently only head to 0 others to 1.
  
      Returns
      -------
      A dictionary mapping the layer names (keys) to their ids (values).
      """
      name_to_id = {}
      # for some models, use head lr in "head" of bbox_head
      # now support: yolov3, faster_rcnn, deformable_detr, yolox, vfnet, centernet, cascade_rcnn, detr, htc, atss, ssd
      registered_head_layers_patterns = [
          "bbox_head.fc_cls",
          "bbox_head.fc_reg",
          "bbox_head.convs_pred",
          "bbox_head.cls_branches",
          "bbox_head.multi_level_conv_cls",
          "bbox_head.multi_level_conv_reg",
          "bbox_head.multi_level_conv_obj",
          "bbox_head.vfnet_cls",
          "bbox_head.heatmap_head",
          "bbox_head.atss_cls",
          "bbox_head.cls_convs",
      ]
      # for other models, use head lr in whole bbox_head
      default_head_layers_patterns = ["bbox_head"]
  
      head_registered = False
      is_yolox = False
      for n, _ in self.named_parameters():
          name_to_id[n] = 1
          for pattern in registered_head_layers_patterns:
              if pattern in n:
                  name_to_id[n] = 0
                  head_registered = True
              if "bbox_head.multi_level_conv_cls" in n:
                  is_yolox = True
  
      if not head_registered:
          for n, _ in self.named_parameters():
              name_to_id[n] = 1
              for pattern in default_head_layers_patterns:
                  if pattern in n:
                      name_to_id[n] = 0
  
      if is_yolox and "use_layer_id" in self.config:
          name_to_id = self.get_yolox_layer_ids()
  
      return name_to_id
  
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 18 for calling the MMDetAutoModelForObjectDetection obj's underlying member method code with example usage: obj.get_layer_ids() and returns: name_to_id