class_docstr: 2D boxes containing N or BxN boxes.
  
  Args:
      boxes: 2D boxes, shape of :math:`(N, 4, 2)`, :math:`(B, N, 4, 2)` or a list of :math:`(N, 4, 2)`.
          See below for more details.
      raise_if_not_floating_point: flag to control floating point casting behaviour when `boxes` is not a
          floating point tensor. True to raise an error when `boxes` isn't a floating point tensor, False
          to cast to float.
      mode: the box format of the input boxes.
  
  Note:
      **2D boxes format** is defined as a floating data type tensor of shape ``Nx4x2`` or ``BxNx4x2``
      where each box is a `quadrilateral <https://en.wikipedia.org/wiki/Quadrilateral>`_ defined by it's
      4 vertices coordinates (A, B, C, D). Coordinates must be in ``x, y`` order. The height and width of
      a box is defined as ``width = xmax - xmin + 1`` and ``height = ymax - ymin + 1``. Examples of
      `quadrilaterals <https://en.wikipedia.org/wiki/Quadrilateral>`_ are rectangles, rhombus and trapezoids.
class_docstr_tok: ["2D","boxes","containing","N","or","BxN","boxes",".","Args",":","boxes",":","2D","boxes",",","shape","of",":","math",":","`","(","N",",","4",",","2",")","`",",",":","math",":","`","(","B",",","N",",","4",",","2",")","`","or","a","list","of",":","math",":","`","(","N",",","4",",","2",")","`",".","See","below","for","more","details",".","raise_if_not_floating_point",":","flag","to","control","floating","point","casting","behaviour","when","`","boxes","`","is","not","a","floating","point","tensor",".","True","to","raise","an","error","when","`","boxes","`","is","n't","a","floating","point","tensor",",","False","to","cast","to","float",".","mode",":","the","box","format","of","the","input","boxes",".","Note",":","*","*","2D","boxes","format","*","*","is","defined","as","a","floating","data","type","tensor","of","shape","``","Nx4x2","``","or","``","BxNx4x2","``","where","each","box","is","a","`","quadrilateral","<","https",":","\/\/en.wikipedia.org\/wiki\/Quadrilateral",">","`","_","defined","by","it's","4","vertices","coordinates","(","A",",","B",",","C",",","D",")",".","Coordinates","must","be","in","``","x",",","y","``","order",".","The","height","and","width","of","a","box","is","defined","as","``","width","=","xmax","-","xmin","+","1","``","and","``","height","=","ymax","-","ymin","+","1","``",".","Examples","of","`","quadrilaterals","<","https",":","\/\/en.wikipedia.org\/wiki\/Quadrilateral",">","`","_","are","rectangles",",","rhombus","and","trapezoids","."]
code: def __init__(
      self,
      boxes: torch.Tensor | list[torch.Tensor],
      raise_if_not_floating_point: bool = True,
      mode: str = "vertices_plus",
  ) -> None:
      self._N: Optional[list[int]] = None
  
      if isinstance(boxes, list):
          boxes, self._N = _merge_box_list(boxes)
  
      if not isinstance(boxes, torch.Tensor):
          raise TypeError(
              f"Input boxes is not a Tensor. Got: {type(boxes)}."
          )
  
      if not boxes.is_floating_point():
          if raise_if_not_floating_point:
              raise ValueError(
                  f"Coordinates must be in floating point. Got {boxes.dtype}"
              )
  
          boxes = boxes.float()
  
      if len(boxes.shape) == 0:
          boxes = boxes.reshape((-1, 4))
  
      if not (3 <= boxes.ndim <= 4 and boxes.shape[-2:] == (4, 2)):
          raise ValueError(
              f"Boxes shape must be (N, 4, 2) or (B, N, 4, 2). Got {boxes.shape}."
          )
  
      self._is_batched = False if boxes.ndim == 3 else True
  
      self._data = boxes
      self._mode = mode
  
imports: from __future__ import annotations
  from typing import Optional, cast
  import torch
  from torch import Size
  from kornia.core import Tensor, stack, zeros
  from kornia.geometry.bbox import validate_bbox
  from kornia.geometry.linalg import transform_points
  from kornia.utils import eye_like
label_desc: Use image node_id 1 to create a new Boxes object  with example: obj = Boxes(boxes, raise_if_not_floating_point, mode)