class_docstr: Side-Aware Boundary Localization (SABL) for RetinaNet.
  
  The anchor generation, assigning and sampling in SABLRetinaHead
  are the same as GuidedAnchorHead for guided anchoring.
  
  Please refer to https://arxiv.org/abs/1912.04260 for more details.
  
  Args:
      num_classes (int): Number of classes.
      in_channels (int): Number of channels in the input feature map.
      stacked_convs (int): Number of Convs for classification             and regression branches. Defaults to 4.
      feat_channels (int): Number of hidden channels.             Defaults to 256.
      approx_anchor_generator (dict): Config dict for approx generator.
      square_anchor_generator (dict): Config dict for square generator.
      conv_cfg (dict): Config dict for ConvModule. Defaults to None.
      norm_cfg (dict): Config dict for Norm Layer. Defaults to None.
      bbox_coder (dict): Config dict for bbox coder.
      reg_decoded_bbox (bool): Whether to regress decoded bbox.             Defaults to False.
      train_cfg (dict): Training config of SABLRetinaHead.
      test_cfg (dict): Testing config of SABLRetinaHead.
      loss_cls (dict): Config of classification loss.
      loss_bbox_cls (dict): Config of classification loss for bbox branch.
      loss_bbox_reg (dict): Config of regression loss for bbox branch.
code: def get_bboxes_single(
      self,
      cls_scores,
      bbox_cls_preds,
      bbox_reg_preds,
      mlvl_anchors,
      img_shape,
      scale_factor,
      cfg,
      rescale=False,
  ):
      cfg = self.test_cfg if cfg is None else cfg
      mlvl_bboxes = []
      mlvl_scores = []
      mlvl_confids = []
      assert (
          len(cls_scores)
          == len(bbox_cls_preds)
          == len(bbox_reg_preds)
          == len(mlvl_anchors)
      )
      for cls_score, bbox_cls_pred, bbox_reg_pred, anchors in zip(
          cls_scores, bbox_cls_preds, bbox_reg_preds, mlvl_anchors
      ):
          assert (
              cls_score.size()[-2:]
              == bbox_cls_pred.size()[-2:]
              == bbox_reg_pred.size()[-2::]
          )
          cls_score = cls_score.permute(1, 2, 0).reshape(
              -1, self.cls_out_channels
          )
          if self.use_sigmoid_cls:
              scores = cls_score.sigmoid()
          else:
              scores = cls_score.softmax(-1)
          bbox_cls_pred = bbox_cls_pred.permute(1, 2, 0).reshape(
              -1, self.side_num * 4
          )
          bbox_reg_pred = bbox_reg_pred.permute(1, 2, 0).reshape(
              -1, self.side_num * 4
          )
          nms_pre = cfg.get("nms_pre", -1)
          if nms_pre > 0 and scores.shape[0] > nms_pre:
              if self.use_sigmoid_cls:
                  max_scores, _ = scores.max(dim=1)
              else:
                  max_scores, _ = scores[:, :-1].max(dim=1)
              _, topk_inds = max_scores.topk(nms_pre)
              anchors = anchors[topk_inds, :]
              bbox_cls_pred = bbox_cls_pred[topk_inds, :]
              bbox_reg_pred = bbox_reg_pred[topk_inds, :]
              scores = scores[topk_inds, :]
          bbox_preds = [
              bbox_cls_pred.contiguous(),
              bbox_reg_pred.contiguous(),
          ]
          bboxes, confids = self.bbox_coder.decode(
              anchors.contiguous(), bbox_preds, max_shape=img_shape
          )
          mlvl_bboxes.append(bboxes)
          mlvl_scores.append(scores)
          mlvl_confids.append(confids)
      mlvl_bboxes = torch.cat(mlvl_bboxes)
      if rescale:
          mlvl_bboxes /= mlvl_bboxes.new_tensor(scale_factor)
      mlvl_scores = torch.cat(mlvl_scores)
      mlvl_confids = torch.cat(mlvl_confids)
      if self.use_sigmoid_cls:
          padding = mlvl_scores.new_zeros(mlvl_scores.shape[0], 1)
          mlvl_scores = torch.cat([mlvl_scores, padding], dim=1)
      det_bboxes, det_labels = multiclass_nms(
          mlvl_bboxes,
          mlvl_scores,
          cfg.score_thr,
          cfg.nms,
          cfg.max_per_img,
          score_factors=mlvl_confids,
      )
      return det_bboxes, det_labels
  
imports: import numpy
  import torch
  import torch.nn
  from mmcv.cnn import ConvModule, bias_init_with_prob, normal_init
  from mmcv.runner import force_fp32
  from mmdet.core import build_anchor_generator, build_assigner, build_bbox_coder, build_sampler, images_to_levels, multi_apply, multiclass_nms, unmap
  from ..builder import HEADS, build_loss
  from .base_dense_head import BaseDenseHead
  from .guided_anchor_head import GuidedAnchorHead
label_desc: Use image node_id 12 for calling the SABLRetinaHead obj's underlying member method code with example usage: obj.get_bboxes_single(cls_scores, bbox_cls_preds, bbox_reg_preds, mlvl_anchors, img_shape, scale_factor, cfg, rescale) and returns: det_bboxes,  det_labels