class_docstr: This is designed specifically for the GLIP algorithm.
  
  In order to completely match the official performance, we need to perform
  special calculations in the encoding and decoding processes, such as
  additional +1 and -1 calculations. However, this is not a user-friendly
  design.
class_docstr_tok: ["This","is","designed","specifically","for","the","GLIP","algorithm",".","In","order","to","completely","match","the","official","performance",",","we","need","to","perform","special","calculations","in","the","encoding","and","decoding","processes",",","such","as","additional","+1","and","-1","calculations",".","However",",","this","is","not","a","user-friendly","design","."]
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 = bbox2delta(
          bboxes, gt_bboxes, self.means, self.stds
      )
      return encoded_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 1 for calling the DeltaXYWHBBoxCoderForGLIP obj's underlying member method code with example usage: obj.encode(bboxes, gt_bboxes) and returns: encoded_bboxes