class_docstr: More general bbox head, with shared conv and fc layers and two optional
  separated branches.
  
  .. code-block:: none
  
                                  /-> cls convs -> cls fcs -> cls
      shared convs -> shared fcs
                                  \-> reg convs -> reg fcs -> reg
docstr: Add shared or separable branch.
  
  convs -> avg pool (optional) -> fcs
docstr_tok: ["Add","shared","or","separable","branch",".","convs","-",">","avg","pool","(","optional",")","-",">","fcs"]
code: def _add_conv_fc_branch(
      self,
      num_branch_convs,
      num_branch_fcs,
      in_channels,
      is_shared=False,
  ):
      """Add shared or separable branch.
  
      convs -> avg pool (optional) -> fcs
      """
      last_layer_dim = in_channels
      # add branch specific conv layers
      branch_convs = nn.ModuleList()
      if num_branch_convs > 0:
          for i in range(num_branch_convs):
              conv_in_channels = (
                  last_layer_dim if i == 0 else self.conv_out_channels
              )
              branch_convs.append(
                  ConvModule(
                      conv_in_channels,
                      self.conv_out_channels,
                      3,
                      padding=1,
                      conv_cfg=self.conv_cfg,
                      norm_cfg=self.norm_cfg,
                  )
              )
          last_layer_dim = self.conv_out_channels
      # add branch specific fc layers
      branch_fcs = nn.ModuleList()
      if num_branch_fcs > 0:
          # for shared branch, only consider self.with_avg_pool
          # for separated branches, also consider self.num_shared_fcs
          if (
              is_shared or self.num_shared_fcs == 0
          ) and not self.with_avg_pool:
              last_layer_dim *= self.roi_feat_area
          for i in range(num_branch_fcs):
              fc_in_channels = (
                  last_layer_dim if i == 0 else self.fc_out_channels
              )
              branch_fcs.append(
                  nn.Linear(fc_in_channels, self.fc_out_channels)
              )
          last_layer_dim = self.fc_out_channels
      return branch_convs, branch_fcs, last_layer_dim
  
file_path: insightface/detection/scrfd/mmdet/models/roi_heads/bbox_heads/convfc_bbox_head.py
imports: import torch.nn
  from mmcv.cnn import ConvModule
  from mmdet.models.builder import HEADS
  from .bbox_head import BBoxHead
label_desc: Use image node_id 2 for calling the ConvFCBBoxHead obj's underlying member method code with example usage: obj._add_conv_fc_branch(num_branch_convs, num_branch_fcs, in_channels, is_shared) and returns: branch_convs,  branch_fcs,  last_layer_dim