Convert the bounding boxes of the current mode to corners. Args: boxes: bounding boxes, Nx4 or Nx6 torch tensor Returns: ``tuple``: corners of boxes, 4-element or 6-element tuple, each element is a Nx1 torch tensor. It represents (xmin,
(self, boxes: torch.Tensor)
| 96 | |
| 97 | @abstractmethod |
| 98 | def boxes_to_corners(self, boxes: torch.Tensor) -> tuple: |
| 99 | """ |
| 100 | Convert the bounding boxes of the current mode to corners. |
| 101 | |
| 102 | Args: |
| 103 | boxes: bounding boxes, Nx4 or Nx6 torch tensor |
| 104 | |
| 105 | Returns: |
| 106 | ``tuple``: corners of boxes, 4-element or 6-element tuple, each element is a Nx1 torch tensor. |
| 107 | It represents (xmin, ymin, xmax, ymax) or (xmin, ymin, zmin, xmax, ymax, zmax) |
| 108 | |
| 109 | Example: |
| 110 | .. code-block:: python |
| 111 | |
| 112 | boxes = torch.ones(10,6) |
| 113 | boxmode = BoxMode() |
| 114 | boxmode.boxes_to_corners(boxes) # will return a 6-element tuple, each element is a 10x1 tensor |
| 115 | """ |
| 116 | raise NotImplementedError(f"Subclass {self.__class__.__name__} must implement this method.") |
| 117 | |
| 118 | @abstractmethod |
| 119 | def corners_to_boxes(self, corners: Sequence) -> torch.Tensor: |
no outgoing calls
no test coverage detected