(
self,
image_keys: KeysCollection,
box_keys: KeysCollection,
box_ref_image_keys: KeysCollection,
k: int = 1,
spatial_axes: tuple[int, int] = (0, 1),
allow_missing_keys: bool = False,
)
| 1234 | backend = RotateBox90.backend |
| 1235 | |
| 1236 | def __init__( |
| 1237 | self, |
| 1238 | image_keys: KeysCollection, |
| 1239 | box_keys: KeysCollection, |
| 1240 | box_ref_image_keys: KeysCollection, |
| 1241 | k: int = 1, |
| 1242 | spatial_axes: tuple[int, int] = (0, 1), |
| 1243 | allow_missing_keys: bool = False, |
| 1244 | ) -> None: |
| 1245 | self.image_keys = ensure_tuple(image_keys) |
| 1246 | self.box_keys = ensure_tuple(box_keys) |
| 1247 | super().__init__(self.image_keys + self.box_keys, allow_missing_keys) |
| 1248 | self.box_ref_image_keys = ensure_tuple_rep(box_ref_image_keys, len(self.box_keys)) |
| 1249 | self.img_rotator = Rotate90(k, spatial_axes) |
| 1250 | self.box_rotator = RotateBox90(k, spatial_axes) |
| 1251 | |
| 1252 | def __call__(self, data: Mapping[Hashable, torch.Tensor]) -> Mapping[Hashable, torch.Tensor]: |
| 1253 | d = dict(data) |
nothing calls this directly
no test coverage detected