class_docstr: The linear box-to-box transform defined in FCOS. The transformation is parameterized
  by the distance from the center of (square) src box to 4 edges of the target box.
class_docstr_tok: ["The","linear","box-to-box","transform","defined","in","FCOS",".","The","transformation","is","parameterized","by","the","distance","from","the","center","of","(","square",")","src","box","to","4","edges","of","the","target","box","."]
docstr: Get box regression transformation deltas (dx1, dy1, dx2, dy2) that can be used
  to transform the `src_boxes` into the `target_boxes`. That is, the relation
  ``target_boxes == self.apply_deltas(deltas, src_boxes)`` is true.
  The center of src must be inside target boxes.
  
  Args:
      src_boxes (Tensor): square source boxes, e.g., anchors
      target_boxes (Tensor): target of the transformation, e.g., ground-truth
          boxes.
docstr_tok: ["Get","box","regression","transformation","deltas","(","dx1",",","dy1",",","dx2",",","dy2",")","that","can","be","used","to","transform","the","`","src_boxes","`","into","the","`","target_boxes","`",".","That","is",",","the","relation","``","target_boxes","==","self.apply_deltas","(","deltas",",","src_boxes",")","``","is","true",".","The","center","of","src","must","be","inside","target","boxes",".","Args",":","src_boxes","(","Tensor",")",":","square","source","boxes",",","e.g.",",","anchors","target_boxes","(","Tensor",")",":","target","of","the","transformation",",","e.g.",",","ground-truth","boxes","."]
code: def get_deltas(self, src_boxes, target_boxes):
      """
      Get box regression transformation deltas (dx1, dy1, dx2, dy2) that can be used
      to transform the `src_boxes` into the `target_boxes`. That is, the relation
      ``target_boxes == self.apply_deltas(deltas, src_boxes)`` is true.
      The center of src must be inside target boxes.
  
      Args:
          src_boxes (Tensor): square source boxes, e.g., anchors
          target_boxes (Tensor): target of the transformation, e.g., ground-truth
              boxes.
      """
      assert isinstance(src_boxes, torch.Tensor), type(src_boxes)
      assert isinstance(target_boxes, torch.Tensor), type(target_boxes)
  
      src_ctr_x = 0.5 * (src_boxes[:, 0] + src_boxes[:, 2])
      src_ctr_y = 0.5 * (src_boxes[:, 1] + src_boxes[:, 3])
  
      target_l = src_ctr_x - target_boxes[:, 0]
      target_t = src_ctr_y - target_boxes[:, 1]
      target_r = target_boxes[:, 2] - src_ctr_x
      target_b = target_boxes[:, 3] - src_ctr_y
  
      deltas = torch.stack(
          (target_l, target_t, target_r, target_b), dim=1
      )
      if self.normalize_by_size:
          stride_w = src_boxes[:, 2] - src_boxes[:, 0]
          stride_h = src_boxes[:, 3] - src_boxes[:, 1]
          strides = torch.stack(
              [stride_w, stride_h, stride_w, stride_h], axis=1
          )
          deltas = deltas / strides
  
      return deltas
  
file_path: detectron2/detectron2/modeling/box_regression.py
imports: import math
  from typing import List, Tuple, Union
  import torch
  from fvcore.nn import giou_loss, smooth_l1_loss
  from torch.nn import functional
  from detectron2.layers import cat, ciou_loss, diou_loss
  from detectron2.structures import Boxes
label_desc: Use image node_id 2 for calling the Box2BoxTransformLinear obj's underlying member method code with example usage: obj.get_deltas(src_boxes, target_boxes) and returns: deltas