code: def param_groups(model):
      body = model.backbone
  
      layers = []
  
      # add the backbone
      if isinstance(body, SSDVGG):
          layers += [body.features]
      elif isinstance(body, CSPDarknet):
          layers += [body.stem.conv.conv, body.stem.conv.bn]
          layers += [body.stage1, body.stage2, body.stage3, body.stage4]
  
      elif isinstance(body, HourglassNet):
          layers += [
              body.stem,
              body.hourglass_modules,
              body.inters,
              body.conv1x1s,
              body.out_convs,
              body.remap_convs,
              body.relu,
          ]
  
      elif isinstance(body, SwinTransformer):
          layers += [
              body.patch_embed.adap_padding,
              body.patch_embed.projection,
              body.patch_embed.norm,
              body.drop_after_pos,
              body.stages,
          ]
  
          # Swin backbone for two-stage detector has norm0 attribute
          if hasattr(body, "norm0"):
              layers += [body.norm0]
  
          layers += [body.norm1, body.norm2, body.norm3]
      else:
          layers += [nn.Sequential(body.conv1, body.bn1)]
          layers += [getattr(body, l) for l in body.res_layers]
  
      # add the neck module if it exists (DETR doesn't have a neck module)
      if hasattr(model, "neck"):
          layers += [model.neck]
  
      # add the head
      if isinstance(model, SingleStageDetector):
          layers += [model.bbox_head]
  
          # YOLACT has mask_head and segm_head
          if hasattr(model, "mask_head"):
              layers += [model.mask_head]
          if hasattr(model, "segm_head"):
              layers += [model.segm_head]
  
      elif isinstance(model, TwoStageDetector):
          layers += [nn.Sequential(model.rpn_head, model.roi_head)]
      else:
          raise RuntimeError(
              "{model} must inherit either from SingleStageDetector or TwoStageDetector class"
          )
  
      _param_groups = [list(layer.parameters()) for layer in layers]
      check_all_model_params_in_groups2(model, _param_groups)
      return _param_groups
  
file_path: icevision/icevision/models/mmdet/utils.py
imports: from numpy import False_
  from icevision.imports import *
  from icevision.utils import *
  from icevision.models.backbone_config import BackboneConfig
  from icevision.models.mmdet.download_configs import download_mmdet_configs
  from mmdet.models.detectors import *
  from mmcv import Config
  from mmdet.models.backbones.ssd_vgg import SSDVGG
  from mmdet.models.backbones.csp_darknet import CSPDarknet
  from mmdet.models.backbones.swin import SwinTransformer
  from mmdet.models.backbones.hourglass import HourglassNet
label_desc: Use image node_id 1 for calling a global function with example usage: param_groups(model) and returns: _param_groups