(
self,
image_keys: KeysCollection,
box_keys: KeysCollection,
box_ref_image_keys: KeysCollection,
spatial_axis: Sequence[int] | int | None = None,
allow_missing_keys: bool = False,
)
| 650 | backend = Flip.backend |
| 651 | |
| 652 | def __init__( |
| 653 | self, |
| 654 | image_keys: KeysCollection, |
| 655 | box_keys: KeysCollection, |
| 656 | box_ref_image_keys: KeysCollection, |
| 657 | spatial_axis: Sequence[int] | int | None = None, |
| 658 | allow_missing_keys: bool = False, |
| 659 | ) -> None: |
| 660 | self.image_keys = ensure_tuple(image_keys) |
| 661 | self.box_keys = ensure_tuple(box_keys) |
| 662 | super().__init__(self.image_keys + self.box_keys, allow_missing_keys) |
| 663 | self.box_ref_image_keys = ensure_tuple_rep(box_ref_image_keys, len(self.box_keys)) |
| 664 | |
| 665 | self.flipper = Flip(spatial_axis=spatial_axis) |
| 666 | self.box_flipper = FlipBox(spatial_axis=self.flipper.spatial_axis) |
| 667 | |
| 668 | def __call__(self, data: Mapping[Hashable, torch.Tensor]) -> dict[Hashable, torch.Tensor]: |
| 669 | d = dict(data) |
nothing calls this directly
no test coverage detected