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