class_docstr: Delta XYWH BBox coder.
  
  Following the practice in `R-CNN <https://arxiv.org/abs/1311.2524>`_,
  this coder encodes bbox (x1, y1, x2, y2) into delta (dx, dy, dw, dh) and
  decodes delta (dx, dy, dw, dh) back to original bbox (x1, y1, x2, y2).
  
  Args:
      target_means (Sequence[float]): Denormalizing means of target for
          delta coordinates
      target_stds (Sequence[float]): Denormalizing standard deviation of
          target for delta coordinates
      clip_border (bool, optional): Whether clip the objects outside the
          border of the image. Defaults to True.
      add_ctr_clamp (bool): Whether to add center clamp, when added, the
          predicted box is clamped is its center is too far away from
          the original anchor's center. Only used by YOLOF. Default False.
      ctr_clamp (int): the maximum pixel shift to clamp. Only used by YOLOF.
          Default 32.
class_docstr_tok: ["Delta","XYWH","BBox","coder",".","Following","the","practice","in","`","R-CNN","<","https",":","\/\/arxiv.org\/abs\/1311.2524",">","`","_",",","this","coder","encodes","bbox","(","x1",",","y1",",","x2",",","y2",")","into","delta","(","dx",",","dy",",","dw",",","dh",")","and","decodes","delta","(","dx",",","dy",",","dw",",","dh",")","back","to","original","bbox","(","x1",",","y1",",","x2",",","y2",")",".","Args",":","target_means","(","Sequence","[","float","]",")",":","Denormalizing","means","of","target","for","delta","coordinates","target_stds","(","Sequence","[","float","]",")",":","Denormalizing","standard","deviation","of","target","for","delta","coordinates","clip_border","(","bool",",","optional",")",":","Whether","clip","the","objects","outside","the","border","of","the","image",".","Defaults","to","True",".","add_ctr_clamp","(","bool",")",":","Whether","to","add","center","clamp",",","when","added",",","the","predicted","box","is","clamped","is","its","center","is","too","far","away","from","the","original","anchor","'s","center",".","Only","used","by","YOLOF",".","Default","False",".","ctr_clamp","(","int",")",":","the","maximum","pixel","shift","to","clamp",".","Only","used","by","YOLOF",".","Default","32","."]
docstr: Apply transformation `pred_bboxes` to `boxes`.
  
  Args:
      bboxes (torch.Tensor or :obj:`BaseBoxes`): Basic boxes. Shape
          (B, N, 4) or (N, 4)
      pred_bboxes (Tensor): Encoded offsets with respect to each roi.
         Has shape (B, N, num_classes * 4) or (B, N, 4) or
         (N, num_classes * 4) or (N, 4). Note N = num_anchors * W * H
         when rois is a grid of anchors.Offset encoding follows [1]_.
      max_shape (Sequence[int] or torch.Tensor or Sequence[
         Sequence[int]],optional): Maximum bounds for boxes, specifies
         (H, W, C) or (H, W). If bboxes shape is (B, N, 4), then
         the max_shape should be a Sequence[Sequence[int]]
         and the length of max_shape should also be B.
      wh_ratio_clip (float, optional): The allowed ratio between
          width and height.
  
  Returns:
      Union[torch.Tensor, :obj:`BaseBoxes`]: Decoded boxes.
docstr_tok: ["Apply","transformation","`","pred_bboxes","`","to","`","boxes","`",".","Args",":","bboxes","(","torch.Tensor","or",":","obj",":","`","BaseBoxes","`",")",":","Basic","boxes",".","Shape","(","B",",","N",",","4",")","or","(","N",",","4",")","pred_bboxes","(","Tensor",")",":","Encoded","offsets","with","respect","to","each","roi",".","Has","shape","(","B",",","N",",","num_classes","*","4",")","or","(","B",",","N",",","4",")","or","(","N",",","num_classes","*","4",")","or","(","N",",","4",")",".","Note","N","=","num_anchors","*","W","*","H","when","rois","is","a","grid","of","anchors.Offset","encoding","follows","[","1","]","_.","max_shape","(","Sequence","[","int","]","or","torch.Tensor","or","Sequence","[","Sequence","[","int","]","]",",","optional",")",":","Maximum","bounds","for","boxes",",","specifies","(","H",",","W",",","C",")","or","(","H",",","W",")",".","If","bboxes","shape","is","(","B",",","N",",","4",")",",","then","the","max_shape","should","be","a","Sequence","[","Sequence","[","int","]","]","and","the","length","of","max_shape","should","also","be","B.","wh_ratio_clip","(","float",",","optional",")",":","The","allowed","ratio","between","width","and","height",".","Returns",":","Union","[","torch.Tensor",",",":","obj",":","`","BaseBoxes","`","]",":","Decoded","boxes","."]
code: def decode(
      self,
      bboxes: Union[Tensor, BaseBoxes],
      pred_bboxes: Tensor,
      max_shape: Optional[
          Union[Sequence[int], Tensor, Sequence[Sequence[int]]]
      ] = None,
      wh_ratio_clip: Optional[float] = 16 / 1000,
  ) -> Union[Tensor, BaseBoxes]:
      """Apply transformation `pred_bboxes` to `boxes`.
  
      Args:
          bboxes (torch.Tensor or :obj:`BaseBoxes`): Basic boxes. Shape
              (B, N, 4) or (N, 4)
          pred_bboxes (Tensor): Encoded offsets with respect to each roi.
             Has shape (B, N, num_classes * 4) or (B, N, 4) or
             (N, num_classes * 4) or (N, 4). Note N = num_anchors * W * H
             when rois is a grid of anchors.Offset encoding follows [1]_.
          max_shape (Sequence[int] or torch.Tensor or Sequence[
             Sequence[int]],optional): Maximum bounds for boxes, specifies
             (H, W, C) or (H, W). If bboxes shape is (B, N, 4), then
             the max_shape should be a Sequence[Sequence[int]]
             and the length of max_shape should also be B.
          wh_ratio_clip (float, optional): The allowed ratio between
              width and height.
  
      Returns:
          Union[torch.Tensor, :obj:`BaseBoxes`]: Decoded boxes.
      """
      bboxes = get_box_tensor(bboxes)
      assert pred_bboxes.size(0) == bboxes.size(0)
      if pred_bboxes.ndim == 3:
          assert pred_bboxes.size(1) == bboxes.size(1)
  
      if pred_bboxes.ndim == 2 and not torch.onnx.is_in_onnx_export():
          # single image decode
          decoded_bboxes = delta2bbox(
              bboxes,
              pred_bboxes,
              self.means,
              self.stds,
              max_shape,
              wh_ratio_clip,
              self.clip_border,
              self.add_ctr_clamp,
              self.ctr_clamp,
          )
      else:
          if (
              pred_bboxes.ndim == 3
              and not torch.onnx.is_in_onnx_export()
          ):
              warnings.warn(
                  "DeprecationWarning: onnx_delta2bbox is deprecated "
                  "in the case of batch decoding and non-ONNX, "
                  "please use “delta2bbox” instead. In order to improve "
                  "the decoding speed, the batch function will no "
                  "longer be supported. "
              )
          decoded_bboxes = onnx_delta2bbox(
              bboxes,
              pred_bboxes,
              self.means,
              self.stds,
              max_shape,
              wh_ratio_clip,
              self.clip_border,
              self.add_ctr_clamp,
              self.ctr_clamp,
          )
  
      if self.use_box_type:
          assert decoded_bboxes.size(-1) == 4, (
              "Cannot warp decoded boxes with box type when decoded boxes"
              "have shape of (N, num_classes * 4)"
          )
          decoded_bboxes = HorizontalBoxes(decoded_bboxes)
      return decoded_bboxes
  
imports: import warnings
  from typing import Optional, Sequence, Union
  import numpy
  import torch
  from torch import Tensor
  from mmdet.registry import TASK_UTILS
  from mmdet.structures.bbox import BaseBoxes, HorizontalBoxes, get_box_tensor
  from .base_bbox_coder import BaseBBoxCoder
label_desc: Use image node_id 3 for calling the DeltaXYWHBBoxCoder obj's underlying member method code with example usage: obj.decode(bboxes, pred_bboxes, max_shape, wh_ratio_clip) and returns: decoded_bboxes