class_docstr: Grid roi head for Grid R-CNN.
  
  https://arxiv.org/abs/1811.12030
docstr: Test without augmentation.
code: def simple_test(
      self, x, proposal_list, img_metas, proposals=None, rescale=False
  ):
      """Test without augmentation."""
      assert self.with_bbox, "Bbox head must be implemented."
  
      det_bboxes, det_labels = self.simple_test_bboxes(
          x, img_metas, proposal_list, self.test_cfg, rescale=False
      )
      # pack rois into bboxes
      grid_rois = bbox2roi([det_bbox[:, :4] for det_bbox in det_bboxes])
      if grid_rois.shape[0] != 0:
          grid_feats = self.grid_roi_extractor(
              x[: len(self.grid_roi_extractor.featmap_strides)],
              grid_rois,
          )
          self.grid_head.test_mode = True
          grid_pred = self.grid_head(grid_feats)
          # split batch grid head prediction back to each image
          num_roi_per_img = tuple(
              len(det_bbox) for det_bbox in det_bboxes
          )
          grid_pred = {
              k: v.split(num_roi_per_img, 0)
              for k, v in grid_pred.items()
          }
  
          # apply bbox post-processing to each image individually
          bbox_results = []
          num_imgs = len(det_bboxes)
          for i in range(num_imgs):
              if det_bboxes[i].shape[0] == 0:
                  bbox_results.append(grid_rois.new_tensor([]))
              else:
                  det_bbox = self.grid_head.get_bboxes(
                      det_bboxes[i],
                      grid_pred["fused"][i],
                      [img_metas[i]],
                  )
                  if rescale:
                      det_bbox[:, :4] /= img_metas[i]["scale_factor"]
                  bbox_results.append(
                      bbox2result(
                          det_bbox,
                          det_labels[i],
                          self.bbox_head.num_classes,
                      )
                  )
      else:
          bbox_results = [
              grid_rois.new_tensor([]) for _ in range(len(det_bboxes))
          ]
  
      if not self.with_mask:
          return bbox_results
      else:
          segm_results = self.simple_test_mask(
              x, img_metas, det_bboxes, det_labels, rescale=rescale
          )
          return list(zip(bbox_results, segm_results))
  
file_path: insightface/detection/scrfd/mmdet/models/roi_heads/grid_roi_head.py
imports: import torch
  from mmdet.core import bbox2result, bbox2roi
  from ..builder import HEADS, build_head, build_roi_extractor
  from .standard_roi_head import StandardRoIHead
label_desc: Use image node_id 6 for calling the GridRoIHead obj's underlying member method code with example usage: obj.simple_test(x, proposal_list, img_metas, proposals, rescale) and returns: bbox_results, list