code: def merge_cfg(self, det_cfg):
      block_cfg = det_cfg["model"]["backbone"]["block_cfg"]
      stage_blocks = tuple(
          [
              int(np.round(x * self.stage_blocks_ratio))
              for x in block_cfg["stage_blocks"]
          ]
      )
      block_cfg["stage_blocks"] = stage_blocks
      stage_planes = [
          int(np.round(x * self.base_channels_ratio)) // 8 * 8
          for x in block_cfg["stage_planes"]
      ]
      block_cfg["stage_planes"] = stage_planes
      det_cfg["model"]["backbone"]["block_cfg"] = block_cfg
      det_cfg["model"]["backbone"]["base_channels"] = stage_planes[0]
      neck_in_planes = (
          stage_planes
          if block_cfg["block"] == "BasicBlock"
          else [4 * x for x in stage_planes]
      )
      det_cfg["model"]["neck"]["in_channels"] = neck_in_planes
  
      fpn_channel = self.fpn_channel // 8 * 8
      head_channel = self.head_channel // 8 * 8
      head_stack = self.head_stack
      det_cfg["model"]["neck"]["out_channels"] = fpn_channel
      det_cfg["model"]["bbox_head"]["in_channels"] = fpn_channel
      det_cfg["model"]["bbox_head"]["feat_channels"] = head_channel
      det_cfg["model"]["bbox_head"]["stacked_convs"] = head_stack
      gn_num_groups = 8
      for _gn_num_groups in [8, 16, 32, 64]:
          if head_channel % _gn_num_groups != 0:
              break
          gn_num_groups = _gn_num_groups
      det_cfg["model"]["bbox_head"]["norm_cfg"][
          "num_groups"
      ] = gn_num_groups
      return det_cfg
  
imports: import os
  import os.path
  import io
  import numpy
  import argparse
  import datetime
  import importlib
  import configparser
  from tqdm import tqdm
  from mmdet.models import build_detector
  import torch
  import autotorch
  from mmcv import Config
  from mmdet.models import build_detector
label_desc: Use image node_id 2 for calling the GenConfigAll obj's underlying member method code with example usage: obj.merge_cfg(det_cfg) and returns: det_cfg