class_docstr: FoveaBox: Beyond Anchor-based Object Detector
  https://arxiv.org/abs/1904.03797
code: def _get_target_single(
      self,
      gt_bboxes_raw,
      gt_labels_raw,
      featmap_size_list=None,
      point_list=None,
  ):
      gt_areas = torch.sqrt(
          (gt_bboxes_raw[:, 2] - gt_bboxes_raw[:, 0])
          * (gt_bboxes_raw[:, 3] - gt_bboxes_raw[:, 1])
      )
      label_list = []
      bbox_target_list = []
      # for each pyramid, find the cls and box target
      for (
          base_len,
          (lower_bound, upper_bound),
          stride,
          featmap_size,
          (y, x),
      ) in zip(
          self.base_edge_list,
          self.scale_ranges,
          self.strides,
          featmap_size_list,
          point_list,
      ):
          # FG cat_id: [0, num_classes -1], BG cat_id: num_classes
          labels = (
              gt_labels_raw.new_zeros(featmap_size) + self.num_classes
          )
          bbox_targets = (
              gt_bboxes_raw.new(featmap_size[0], featmap_size[1], 4) + 1
          )
          # scale assignment
          hit_indices = (
              ((gt_areas >= lower_bound) & (gt_areas <= upper_bound))
              .nonzero()
              .flatten()
          )
          if len(hit_indices) == 0:
              label_list.append(labels)
              bbox_target_list.append(torch.log(bbox_targets))
              continue
          _, hit_index_order = torch.sort(-gt_areas[hit_indices])
          hit_indices = hit_indices[hit_index_order]
          gt_bboxes = gt_bboxes_raw[hit_indices, :] / stride
          gt_labels = gt_labels_raw[hit_indices]
          half_w = 0.5 * (gt_bboxes[:, 2] - gt_bboxes[:, 0])
          half_h = 0.5 * (gt_bboxes[:, 3] - gt_bboxes[:, 1])
          # valid fovea area: left, right, top, down
          pos_left = (
              torch.ceil(
                  gt_bboxes[:, 0] + (1 - self.sigma) * half_w - 0.5
              )
              .long()
              .clamp(0, featmap_size[1] - 1)
          )
          pos_right = (
              torch.floor(
                  gt_bboxes[:, 0] + (1 + self.sigma) * half_w - 0.5
              )
              .long()
              .clamp(0, featmap_size[1] - 1)
          )
          pos_top = (
              torch.ceil(
                  gt_bboxes[:, 1] + (1 - self.sigma) * half_h - 0.5
              )
              .long()
              .clamp(0, featmap_size[0] - 1)
          )
          pos_down = (
              torch.floor(
                  gt_bboxes[:, 1] + (1 + self.sigma) * half_h - 0.5
              )
              .long()
              .clamp(0, featmap_size[0] - 1)
          )
          for (
              px1,
              py1,
              px2,
              py2,
              label,
              (gt_x1, gt_y1, gt_x2, gt_y2),
          ) in zip(
              pos_left,
              pos_top,
              pos_right,
              pos_down,
              gt_labels,
              gt_bboxes_raw[hit_indices, :],
          ):
              labels[py1 : py2 + 1, px1 : px2 + 1] = label
              bbox_targets[py1 : py2 + 1, px1 : px2 + 1, 0] = (
                  stride * x[py1 : py2 + 1, px1 : px2 + 1] - gt_x1
              ) / base_len
              bbox_targets[py1 : py2 + 1, px1 : px2 + 1, 1] = (
                  stride * y[py1 : py2 + 1, px1 : px2 + 1] - gt_y1
              ) / base_len
              bbox_targets[py1 : py2 + 1, px1 : px2 + 1, 2] = (
                  gt_x2 - stride * x[py1 : py2 + 1, px1 : px2 + 1]
              ) / base_len
              bbox_targets[py1 : py2 + 1, px1 : px2 + 1, 3] = (
                  gt_y2 - stride * y[py1 : py2 + 1, px1 : px2 + 1]
              ) / base_len
          bbox_targets = bbox_targets.clamp(min=1.0 / 16, max=16.0)
          label_list.append(labels)
          bbox_target_list.append(torch.log(bbox_targets))
      return label_list, bbox_target_list
  
imports: import torch
  import torch.nn
  from mmcv.cnn import ConvModule, normal_init
  from mmcv.ops import DeformConv2d
  from mmdet.core import multi_apply, multiclass_nms
  from ..builder import HEADS
  from .anchor_free_head import AnchorFreeHead
label_desc: Use image node_id 8 for calling the FoveaHead obj's underlying member method code with example usage: obj._get_target_single(gt_bboxes_raw, gt_labels_raw, featmap_size_list, point_list) and returns: label_list,  bbox_target_list