Expects a numpy array shape Bx4. Requires the original image size in (H, W) format.
(self, boxes: np.ndarray, original_size: Tuple[int, ...])
| 45 | return coords |
| 46 | |
| 47 | def apply_boxes(self, boxes: np.ndarray, original_size: Tuple[int, ...]) -> np.ndarray: |
| 48 | """ |
| 49 | Expects a numpy array shape Bx4. Requires the original image size |
| 50 | in (H, W) format. |
| 51 | """ |
| 52 | boxes = self.apply_coords(boxes.reshape(-1, 2, 2), original_size) |
| 53 | return boxes.reshape(-1, 4) |
| 54 | |
| 55 | def apply_image_torch(self, image: torch.Tensor) -> torch.Tensor: |
| 56 | """ |
nothing calls this directly
no test coverage detected