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_bboxes(
      self,
      rois,
      cls_score,
      bbox_pred,
      img_shape,
      scale_factor,
      rescale=False,
      cfg=None,
  ):
      if isinstance(cls_score, list):
          cls_score = sum(cls_score) / float(len(cls_score))
      scores = (
          F.softmax(cls_score, dim=1) if cls_score is not None else None
      )
  
      if bbox_pred is not None:
          bboxes = self.bbox_coder.decode(
              rois[:, 1:], bbox_pred, max_shape=img_shape
          )
      else:
          bboxes = rois[:, 1:].clone()
          if img_shape is not None:
              bboxes[:, [0, 2]].clamp_(min=0, max=img_shape[1])
              bboxes[:, [1, 3]].clamp_(min=0, max=img_shape[0])
  
      if rescale and bboxes.size(0) > 0:
          if isinstance(scale_factor, float):
              bboxes /= scale_factor
          else:
              scale_factor = bboxes.new_tensor(scale_factor)
              bboxes = (
                  bboxes.view(bboxes.size(0), -1, 4) / scale_factor
              ).view(bboxes.size()[0], -1)
  
      if cfg is None:
          return bboxes, scores
      else:
          det_bboxes, det_labels = multiclass_nms(
              bboxes, scores, cfg.score_thr, cfg.nms, cfg.max_per_img
          )
  
          return det_bboxes, det_labels
  
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 7 for calling the BBoxHead obj's underlying member method code with example usage: obj.get_bboxes(rois, cls_score, bbox_pred, img_shape, scale_factor, rescale, cfg) and returns: bboxes,  scores, det_bboxes,  det_labels