Expects a torch tensor with shape Bx4. Requires the original image size in (H, W) format.
(
self, boxes: torch.Tensor, original_size: Tuple[int, ...]
)
| 81 | return coords |
| 82 | |
| 83 | def apply_boxes_torch( |
| 84 | self, boxes: torch.Tensor, original_size: Tuple[int, ...] |
| 85 | ) -> torch.Tensor: |
| 86 | """ |
| 87 | Expects a torch tensor with shape Bx4. Requires the original image |
| 88 | size in (H, W) format. |
| 89 | """ |
| 90 | boxes = self.apply_coords_torch(boxes.reshape(-1, 2, 2), original_size) |
| 91 | return boxes.reshape(-1, 4) |
| 92 | |
| 93 | @staticmethod |
| 94 | def get_preprocess_shape(oldh: int, oldw: int, long_side_length: int) -> Tuple[int, int]: |
nothing calls this directly
no test coverage detected