class_docstr: Grid roi head for Grid R-CNN.
  
  https://arxiv.org/abs/1811.12030
docstr: Ramdom jitter positive proposals for training.
code: def _random_jitter(self, sampling_results, img_metas, amplitude=0.15):
      """Ramdom jitter positive proposals for training."""
      for sampling_result, img_meta in zip(sampling_results, img_metas):
          bboxes = sampling_result.pos_bboxes
          random_offsets = bboxes.new_empty(
              bboxes.shape[0], 4
          ).uniform_(-amplitude, amplitude)
          # before jittering
          cxcy = (bboxes[:, 2:4] + bboxes[:, :2]) / 2
          wh = (bboxes[:, 2:4] - bboxes[:, :2]).abs()
          # after jittering
          new_cxcy = cxcy + wh * random_offsets[:, :2]
          new_wh = wh * (1 + random_offsets[:, 2:])
          # xywh to xyxy
          new_x1y1 = new_cxcy - new_wh / 2
          new_x2y2 = new_cxcy + new_wh / 2
          new_bboxes = torch.cat([new_x1y1, new_x2y2], dim=1)
          # clip bboxes
          max_shape = img_meta["img_shape"]
          if max_shape is not None:
              new_bboxes[:, 0::2].clamp_(min=0, max=max_shape[1] - 1)
              new_bboxes[:, 1::2].clamp_(min=0, max=max_shape[0] - 1)
  
          sampling_result.pos_bboxes = new_bboxes
      return sampling_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 3 for calling the GridRoIHead obj's underlying member method code with example usage: obj._random_jitter(sampling_results, img_metas, amplitude) and returns: sampling_results