Convert the given box corners to the bounding boxes of the current mode. Args: corners: corners of boxes, 4-element or 6-element tuple, each element is a Nx1 torch tensor. It represents (xmin, ymin, xmax, ymax) or (xmin, ymin, zmin, xmax, ymax, zmax)
(self, corners: Sequence)
| 117 | |
| 118 | @abstractmethod |
| 119 | def corners_to_boxes(self, corners: Sequence) -> torch.Tensor: |
| 120 | """ |
| 121 | Convert the given box corners to the bounding boxes of the current mode. |
| 122 | |
| 123 | Args: |
| 124 | corners: corners of boxes, 4-element or 6-element tuple, each element is a Nx1 torch tensor. |
| 125 | It represents (xmin, ymin, xmax, ymax) or (xmin, ymin, zmin, xmax, ymax, zmax) |
| 126 | |
| 127 | Returns: |
| 128 | ``Tensor``: bounding boxes, Nx4 or Nx6 torch tensor |
| 129 | |
| 130 | Example: |
| 131 | .. code-block:: python |
| 132 | |
| 133 | corners = (torch.ones(10,1), torch.ones(10,1), torch.ones(10,1), torch.ones(10,1)) |
| 134 | boxmode = BoxMode() |
| 135 | boxmode.corners_to_boxes(corners) # will return a 10x4 tensor |
| 136 | """ |
| 137 | raise NotImplementedError(f"Subclass {self.__class__.__name__} must implement this method.") |
| 138 | |
| 139 | |
| 140 | class CornerCornerModeTypeA(BoxMode): |