class_docstr: TBLR BBox coder.
  
  Following the practice in `FSAF <https://arxiv.org/abs/1903.00621>`_,
  this coder encodes gt bboxes (x1, y1, x2, y2) into (top, bottom, left,
  right) and decode it back to the original.
  
  Args:
      normalizer (list | float): Normalization factor to be
        divided with when coding the coordinates. If it is a list, it should
        have length of 4 indicating normalization factor in tblr dims.
        Otherwise it is a unified float factor for all dims. Default: 4.0
      clip_border (bool, optional): Whether clip the objects outside the
          border of the image. Defaults to True.
class_docstr_tok: ["TBLR","BBox","coder",".","Following","the","practice","in","`","FSAF","<","https",":","\/\/arxiv.org\/abs\/1903.00621",">","`","_",",","this","coder","encodes","gt","bboxes","(","x1",",","y1",",","x2",",","y2",")","into","(","top",",","bottom",",","left",",","right",")","and","decode","it","back","to","the","original",".","Args",":","normalizer","(","list","|","float",")",":","Normalization","factor","to","be","divided","with","when","coding","the","coordinates",".","If","it","is","a","list",",","it","should","have","length","of","4","indicating","normalization","factor","in","tblr","dims",".","Otherwise","it","is","a","unified","float","factor","for","all","dims",".","Default",":","4.0","clip_border","(","bool",",","optional",")",":","Whether","clip","the","objects","outside","the","border","of","the","image",".","Defaults","to","True","."]
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 (torch.Tensor): Encoded boxes with shape
         (B, N, 4) or (N, 4)
      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.
  
  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","(","torch.Tensor",")",":","Encoded","boxes","with","shape","(","B",",","N",",","4",")","or","(","N",",","4",")","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",".","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,
  ) -> 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 (torch.Tensor): Encoded boxes with shape
             (B, N, 4) or (N, 4)
          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.
  
      Returns:
          Union[torch.Tensor, :obj:`BaseBoxes`]: Decoded boxes.
      """
      bboxes = get_box_tensor(bboxes)
      decoded_bboxes = tblr2bboxes(
          bboxes,
          pred_bboxes,
          normalizer=self.normalizer,
          max_shape=max_shape,
          clip_border=self.clip_border,
      )
  
      if self.use_box_type:
          decoded_bboxes = HorizontalBoxes(decoded_bboxes)
      return decoded_bboxes
  
file_path: mmdetection/mmdet/models/task_modules/coders/tblr_bbox_coder.py
imports: from typing import Optional, Sequence, Union
  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 TBLRBBoxCoder obj's underlying member method code with example usage: obj.decode(bboxes, pred_bboxes, max_shape) and returns: decoded_bboxes