class_docstr: Legacy Delta XYWH BBox coder used in MMDet V1.x.
  
  Following the practice in R-CNN [1]_, 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).
  
  Note:
      The main difference between :class`LegacyDeltaXYWHBBoxCoder` and
      :class:`DeltaXYWHBBoxCoder` is whether ``+ 1`` is used during width and
      height calculation. We suggest to only use this coder when testing with
      MMDet V1.x models.
  
  References:
      .. [1] https://arxiv.org/abs/1311.2524
  
  Args:
      target_means (Sequence[float]): denormalizing means of target for
          delta coordinates
      target_stds (Sequence[float]): denormalizing standard deviation of
          target for delta coordinates
class_docstr_tok: ["Legacy","Delta","XYWH","BBox","coder","used","in","MMDet","V1.x",".","Following","the","practice","in","R-CNN","[","1","]","_",",","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",")",".","Note",":","The","main","difference","between",":","class","`","LegacyDeltaXYWHBBoxCoder","`","and",":","class",":","`","DeltaXYWHBBoxCoder","`","is","whether","``","+","1","``","is","used","during","width","and","height","calculation",".","We","suggest","to","only","use","this","coder","when","testing","with","MMDet","V1.x","models",".","References",":","..","[","1","]","https",":","\/\/arxiv.org\/abs\/1311.2524","Args",":","target_means","(","Sequence","[","float","]",")",":","denormalizing","means","of","target","for","delta","coordinates","target_stds","(","Sequence","[","float","]",")",":","denormalizing","standard","deviation","of","target","for","delta","coordinates"]
docstr: Get box regression transformation deltas that can be used to
  transform the ``bboxes`` into the ``gt_bboxes``.
  
  Args:
      bboxes (torch.Tensor or :obj:`BaseBoxes`): source boxes,
          e.g., object proposals.
      gt_bboxes (torch.Tensor or :obj:`BaseBoxes`): target of the
          transformation, e.g., ground-truth boxes.
  
  Returns:
      torch.Tensor: Box transformation deltas
docstr_tok: ["Get","box","regression","transformation","deltas","that","can","be","used","to","transform","the","``","bboxes","``","into","the","``","gt_bboxes","``",".","Args",":","bboxes","(","torch.Tensor","or",":","obj",":","`","BaseBoxes","`",")",":","source","boxes",",","e.g.",",","object","proposals",".","gt_bboxes","(","torch.Tensor","or",":","obj",":","`","BaseBoxes","`",")",":","target","of","the","transformation",",","e.g.",",","ground-truth","boxes",".","Returns",":","torch.Tensor",":","Box","transformation","deltas"]
code: def encode(
      self,
      bboxes: Union[Tensor, BaseBoxes],
      gt_bboxes: Union[Tensor, BaseBoxes],
  ) -> Tensor:
      """Get box regression transformation deltas that can be used to
      transform the ``bboxes`` into the ``gt_bboxes``.
  
      Args:
          bboxes (torch.Tensor or :obj:`BaseBoxes`): source boxes,
              e.g., object proposals.
          gt_bboxes (torch.Tensor or :obj:`BaseBoxes`): target of the
              transformation, e.g., ground-truth boxes.
  
      Returns:
          torch.Tensor: Box transformation deltas
      """
      bboxes = get_box_tensor(bboxes)
      gt_bboxes = get_box_tensor(gt_bboxes)
      assert bboxes.size(0) == gt_bboxes.size(0)
      assert bboxes.size(-1) == gt_bboxes.size(-1) == 4
      encoded_bboxes = legacy_bbox2delta(
          bboxes, gt_bboxes, self.means, self.stds
      )
      return encoded_bboxes
  
file_path: mmdetection/mmdet/models/task_modules/coders/legacy_delta_xywh_bbox_coder.py
imports: 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 2 for calling the LegacyDeltaXYWHBBoxCoder obj's underlying member method code with example usage: obj.encode(bboxes, gt_bboxes) and returns: encoded_bboxes