Expects a tensor of shape Bx4. The coordinates can be in absolute image or normalized coordinates, if the coords are in absolute image coordinates, normalize should be set to True and original image size is required.
(
self, boxes: torch.Tensor, normalize=False, orig_hw=None
)
| 62 | return coords |
| 63 | |
| 64 | def transform_boxes( |
| 65 | self, boxes: torch.Tensor, normalize=False, orig_hw=None |
| 66 | ) -> torch.Tensor: |
| 67 | """ |
| 68 | Expects a tensor of shape Bx4. The coordinates can be in absolute image or normalized coordinates, |
| 69 | if the coords are in absolute image coordinates, normalize should be set to True and original image size is required. |
| 70 | """ |
| 71 | boxes = self.transform_coords(boxes.reshape(-1, 2, 2), normalize, orig_hw) |
| 72 | return boxes |
| 73 | |
| 74 | def postprocess_masks(self, masks: torch.Tensor, orig_hw) -> torch.Tensor: |
| 75 | """ |
no test coverage detected