class_docstr: Detection Head of `DDOD <https://arxiv.org/abs/2107.02963>`_.
  
  DDOD head decomposes conjunctions lying in most current one-stage
  detectors via label assignment disentanglement, spatial feature
  disentanglement, and pyramid supervision disentanglement.
  
  Args:
      num_classes (int): Number of categories excluding the
          background category.
      in_channels (int): Number of channels in the input feature map.
      stacked_convs (int): The number of stacked Conv. Defaults to 4.
      conv_cfg (:obj:`ConfigDict` or dict, optional): Config dict for
          convolution layer. Defaults to None.
      use_dcn (bool): Use dcn, Same as ATSS when False. Defaults to True.
      norm_cfg (:obj:`ConfigDict` or dict): Normal config of ddod head.
          Defaults to dict(type='GN', num_groups=32, requires_grad=True).
      loss_iou (:obj:`ConfigDict` or dict): Config of IoU loss. Defaults to
          dict(type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0).
docstr: Compute reweight_factor for regression and classification loss.
docstr_tok: ["Compute","reweight_factor","for","regression","and","classification","loss","."]
code: def calc_reweight_factor(
      self, labels_list: List[Tensor]
  ) -> List[float]:
      """Compute reweight_factor for regression and classification loss."""
      # get pos samples for each level
      bg_class_ind = self.num_classes
      for ii, each_level_label in enumerate(labels_list):
          pos_inds = (
              (
                  (each_level_label >= 0)
                  & (each_level_label < bg_class_ind)
              )
              .nonzero(as_tuple=False)
              .squeeze(1)
          )
          self.cls_num_pos_samples_per_level[ii] += len(pos_inds)
      # get reweight factor from 1 ~ 2 with bilinear interpolation
      min_pos_samples = min(self.cls_num_pos_samples_per_level)
      max_pos_samples = max(self.cls_num_pos_samples_per_level)
      interval = 1.0 / (max_pos_samples - min_pos_samples + 1e-10)
      reweight_factor_per_level = []
      for pos_samples in self.cls_num_pos_samples_per_level:
          factor = 2.0 - (pos_samples - min_pos_samples) * interval
          reweight_factor_per_level.append(factor)
      return reweight_factor_per_level
  
imports: from typing import List, Optional, Sequence, Tuple
  import torch
  import torch.nn
  from mmcv.cnn import ConvModule, Scale
  from mmengine.model import bias_init_with_prob, normal_init
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS, TASK_UTILS
  from mmdet.structures.bbox import bbox_overlaps
  from mmdet.utils import ConfigType, InstanceList, OptConfigType, OptInstanceList, reduce_mean
  from ..task_modules.prior_generators import anchor_inside_flags
  from ..utils import images_to_levels, multi_apply, unmap
  from .anchor_head import AnchorHead
label_desc: Use image node_id 8 for calling the DDODHead obj's underlying member method code with example usage: obj.calc_reweight_factor(labels_list) and returns: reweight_factor_per_level