class_docstr: The box-to-box transform defined in R-CNN. The transformation is parameterized
  by 4 deltas: (dx, dy, dw, dh). The transformation scales the box's width and height
  by exp(dw), exp(dh) and shifts a box's center by the offset (dx * width, dy * height).
class_docstr_tok: ["The","box-to-box","transform","defined","in","R-CNN",".","The","transformation","is","parameterized","by","4","deltas",":","(","dx",",","dy",",","dw",",","dh",")",".","The","transformation","scales","the","box","'s","width","and","height","by","exp","(","dw",")",",","exp","(","dh",")","and","shifts","a","box","'s","center","by","the","offset","(","dx","*","width",",","dy","*","height",")","."]
docstr: Args:
      weights (4-element tuple): Scaling factors that are applied to the
          (dx, dy, dw, dh) deltas. In Fast R-CNN, these were originally set
          such that the deltas have unit variance; now they are treated as
          hyperparameters of the system.
      scale_clamp (float): When predicting deltas, the predicted box scaling
          factors (dw and dh) are clamped such that they are <= scale_clamp.
docstr_tok: ["Args",":","weights","(","4-element","tuple",")",":","Scaling","factors","that","are","applied","to","the","(","dx",",","dy",",","dw",",","dh",")","deltas",".","In","Fast","R-CNN",",","these","were","originally","set","such","that","the","deltas","have","unit","variance",";","now","they","are","treated","as","hyperparameters","of","the","system",".","scale_clamp","(","float",")",":","When","predicting","deltas",",","the","predicted","box","scaling","factors","(","dw","and","dh",")","are","clamped","such","that","they","are","<","=","scale_clamp","."]
code: def __init__(
      self,
      weights: Tuple[float, float, float, float],
      scale_clamp: float = _DEFAULT_SCALE_CLAMP,
  ):
      """
      Args:
          weights (4-element tuple): Scaling factors that are applied to the
              (dx, dy, dw, dh) deltas. In Fast R-CNN, these were originally set
              such that the deltas have unit variance; now they are treated as
              hyperparameters of the system.
          scale_clamp (float): When predicting deltas, the predicted box scaling
              factors (dw and dh) are clamped such that they are <= scale_clamp.
      """
      self.weights = weights
      self.scale_clamp = scale_clamp
  
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 1 to create a new Box2BoxTransform object  with example: obj = Box2BoxTransform(weights, scale_clamp)