Computes the area of all the boxes. Returns: torch.Tensor: a vector with areas of each box.
(self)
| 173 | return Boxes(self.tensor.to(device=device)) |
| 174 | |
| 175 | def area(self) -> torch.Tensor: |
| 176 | """ |
| 177 | Computes the area of all the boxes. |
| 178 | |
| 179 | Returns: |
| 180 | torch.Tensor: a vector with areas of each box. |
| 181 | """ |
| 182 | box = self.tensor |
| 183 | area = (box[:, 2] - box[:, 0]) * (box[:, 3] - box[:, 1]) |
| 184 | return area |
| 185 | |
| 186 | def clip(self, box_size: Tuple[int, int]) -> None: |
| 187 | """ |
no outgoing calls