code: def YXdelta2bbox(
      rois,
      deltas,
      means=(0.0, 0.0, 0.0, 0.0),
      stds=(1.0, 1.0, 1.0, 1.0),
      max_shape=None,
      hw_ratio_clip=1000 / 16,
      clip_border=True,
      add_ctr_clamp=False,
      ctr_clamp=32,
  ):
      """Apply deltas to shift/scale base boxes.
  
      Typically the rois are anchor or proposed bounding boxes and the deltas are
      network outputs used to shift/scale those boxes.
      This is the inverse function of :func:`bbox2delta`.
  
      Args:
          rois (Tensor): Boxes to be transformed. Has shape (N, 4).
          deltas (Tensor): Encoded offsets relative to each roi.
              Has shape (N, num_classes * 4) or (N, 4). Note
              N = num_base_anchors * W * H, when rois is a grid of
              anchors. Offset encoding follows [1]_.
          means (Sequence[float]): Denormalizing means for delta coordinates.
              Default (0., 0., 0., 0.).
          stds (Sequence[float]): Denormalizing standard deviation for delta
              coordinates. Default (1., 1., 1., 1.).
          max_shape (tuple[int, int]): Maximum bounds for boxes, specifies
             (H, W). Default None.
          wh_ratio_clip (float): Maximum aspect ratio for boxes. Default
              16 / 1000.
          clip_border (bool, optional): Whether clip the objects outside the
              border of the image. Default True.
          add_ctr_clamp (bool): Whether to add center clamp. When set to True,
              the center of the prediction bounding box will be clamped to
              avoid being too far away from the center of the anchor.
              Only used by YOLOF. Default False.
          ctr_clamp (int): the maximum pixel shift to clamp. Only used by YOLOF.
              Default 32.
  
      Returns:
          Tensor: Boxes with shape (N, num_classes * 4) or (N, 4), where 4
             represent tl_x, tl_y, br_x, br_y.
  
      References:
          .. [1] https://arxiv.org/abs/1311.2524
  
      Example:
          >>> rois = torch.Tensor([[ 0.,  0.,  1.,  1.],
          >>>                      [ 0.,  0.,  1.,  1.],
          >>>                      [ 0.,  0.,  1.,  1.],
          >>>                      [ 5.,  5.,  5.,  5.]])
          >>> deltas = torch.Tensor([[  0.,   0.,   0.,   0.],
          >>>                        [  1.,   1.,   1.,   1.],
          >>>                        [  0.,   0.,   2.,  -1.],
          >>>                        [ 0.7, -1.9, -0.5,  0.3]])
          >>> delta2bbox(rois, deltas, max_shape=(32, 32, 3))
          tensor([[0.0000, 0.0000, 1.0000, 1.0000],
                  [0.1409, 0.1409, 2.8591, 2.8591],
                  [0.0000, 0.3161, 4.1945, 0.6839],
                  [5.0000, 5.0000, 5.0000, 5.0000]])
      """
      num_bboxes, num_classes = deltas.size(0), deltas.size(1) // 4
      if num_bboxes == 0:
          return deltas
  
      deltas = deltas.reshape(-1, 4)
  
      means = deltas.new_tensor(means).view(1, -1)
      stds = deltas.new_tensor(stds).view(1, -1)
      denorm_deltas = deltas * stds + means
  
      dyx = denorm_deltas[:, :2]
      dhw = denorm_deltas[:, 2:]
  
      # Compute width/height of each roi
      rois_ = rois.repeat(1, num_classes).reshape(-1, 4)
      pyx = (rois_[:, :2] + rois_[:, 2:]) * 0.5
      phw = rois_[:, 2:] - rois_[:, :2]
  
      dyx_hw = phw * dyx
  
      max_ratio = np.abs(np.log(hw_ratio_clip))
      if add_ctr_clamp:
          dyx_hw = torch.clamp(dyx_hw, max=ctr_clamp, min=-ctr_clamp)
          dhw = torch.clamp(dhw, max=max_ratio)
      else:
          dhw = dhw.clamp(min=-max_ratio, max=max_ratio)
  
      gyx = pyx + dyx_hw
      ghw = phw * dhw.exp()
      y1x1 = gyx - (ghw * 0.5)
      y2x2 = gyx + (ghw * 0.5)
      ymin, xmin = y1x1[:, 0].reshape(-1, 1), y1x1[:, 1].reshape(-1, 1)
      ymax, xmax = y2x2[:, 0].reshape(-1, 1), y2x2[:, 1].reshape(-1, 1)
      bboxes = torch.cat([xmin, ymin, xmax, ymax], dim=-1)
      if clip_border and max_shape is not None:
          bboxes[..., 0::2].clamp_(min=0, max=max_shape[1])
          bboxes[..., 1::2].clamp_(min=0, max=max_shape[0])
      bboxes = bboxes.reshape(num_bboxes, -1)
      return bboxes
  
file_path: mmdetection/projects/EfficientDet/efficientdet/tensorflow/yxyx_bbox_coder.py
imports: import warnings
  import numpy
  import torch
  from mmdet.models.task_modules.coders.delta_xywh_bbox_coder import DeltaXYWHBBoxCoder
  from mmdet.registry import TASK_UTILS
  from mmdet.structures.bbox import HorizontalBoxes, get_box_tensor
label_desc: Use image node_id 1 for calling a global function with example usage: YXdelta2bbox(rois, deltas, means, stds, max_shape, hw_ratio_clip, clip_border, add_ctr_clamp, ctr_clamp) and returns: bboxes, deltas