(
self,
box_keys: KeysCollection,
label_keys: KeysCollection,
box_ref_image_keys: KeysCollection,
remove_empty: bool = True,
allow_missing_keys: bool = False,
)
| 801 | """ |
| 802 | |
| 803 | def __init__( |
| 804 | self, |
| 805 | box_keys: KeysCollection, |
| 806 | label_keys: KeysCollection, |
| 807 | box_ref_image_keys: KeysCollection, |
| 808 | remove_empty: bool = True, |
| 809 | allow_missing_keys: bool = False, |
| 810 | ) -> None: |
| 811 | box_keys_tuple = ensure_tuple(box_keys) |
| 812 | if len(box_keys_tuple) != 1: |
| 813 | raise ValueError("Provide a single key for `box_keys`. All `label_keys` are attached to this `box_keys`.") |
| 814 | box_ref_image_keys_tuple = ensure_tuple(box_ref_image_keys) |
| 815 | if len(box_ref_image_keys_tuple) != 1: |
| 816 | raise ValueError( |
| 817 | "Provide a single key for `box_ref_image_keys`. " |
| 818 | "All `box_keys` and `label_keys` are attached to this `box_ref_image_keys`." |
| 819 | ) |
| 820 | |
| 821 | self.label_keys = ensure_tuple(label_keys) |
| 822 | super().__init__(box_keys_tuple, allow_missing_keys) |
| 823 | |
| 824 | self.box_keys = box_keys_tuple[0] |
| 825 | self.box_ref_image_keys = box_ref_image_keys_tuple[0] |
| 826 | self.clipper = ClipBoxToImage(remove_empty=remove_empty) |
| 827 | |
| 828 | def __call__(self, data: Mapping[Hashable, NdarrayOrTensor]) -> dict[Hashable, NdarrayOrTensor]: |
| 829 | d = dict(data) |
nothing calls this directly
no test coverage detected