MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / boxes_to_corners

Method boxes_to_corners

monai/data/box_utils.py:98–116  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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:

Callers 2

convert_box_modeFunction · 0.45
convert_box_to_pointsFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected