class_docstr: Simplest RoI head, with only two fc layers for classification and
  regression respectively.
class_docstr_tok: ["Simplest","RoI","head",",","with","only","two","fc","layers","for","classification","and","regression","respectively","."]
code: def _get_target_single(
      self, pos_bboxes, neg_bboxes, pos_gt_bboxes, pos_gt_labels, cfg
  ):
      num_pos = pos_bboxes.size(0)
      num_neg = neg_bboxes.size(0)
      num_samples = num_pos + num_neg
  
      # original implementation uses new_zeros since BG are set to be 0
      # now use empty & fill because BG cat_id = num_classes,
      # FG cat_id = [0, num_classes-1]
      labels = pos_bboxes.new_full(
          (num_samples,), self.num_classes, dtype=torch.long
      )
      label_weights = pos_bboxes.new_zeros(num_samples)
      bbox_targets = pos_bboxes.new_zeros(num_samples, 4)
      bbox_weights = pos_bboxes.new_zeros(num_samples, 4)
      if num_pos > 0:
          labels[:num_pos] = pos_gt_labels
          pos_weight = 1.0 if cfg.pos_weight <= 0 else cfg.pos_weight
          label_weights[:num_pos] = pos_weight
          if not self.reg_decoded_bbox:
              pos_bbox_targets = self.bbox_coder.encode(
                  pos_bboxes, pos_gt_bboxes
              )
          else:
              pos_bbox_targets = pos_gt_bboxes
          bbox_targets[:num_pos, :] = pos_bbox_targets
          bbox_weights[:num_pos, :] = 1
      if num_neg > 0:
          label_weights[-num_neg:] = 1.0
  
      return labels, label_weights, bbox_targets, bbox_weights
  
file_path: insightface/detection/scrfd/mmdet/models/roi_heads/bbox_heads/bbox_head.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.runner import auto_fp16, force_fp32
  from torch.nn.modules.utils import _pair
  from mmdet.core import build_bbox_coder, multi_apply, multiclass_nms
  from mmdet.models.builder import HEADS, build_loss
  from mmdet.models.losses import accuracy
label_desc: Use image node_id 4 for calling the BBoxHead obj's underlying member method code with example usage: obj._get_target_single(pos_bboxes, neg_bboxes, pos_gt_bboxes, pos_gt_labels, cfg) and returns: labels,  label_weights,  bbox_targets,  bbox_weights