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

Method corners_to_boxes

monai/data/box_utils.py:119–137  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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
140class CornerCornerModeTypeA(BoxMode):

Callers 1

convert_box_modeFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected