def __init__(self, keys: KeysCollection, name: str, *args, **kwargs) -> None: """ Args: keys: keys of the corresponding items to be transformed. See also: :py:class:`monai.transforms.compose.MapTransform` name: The transform name in TorchVision package. args: parameters for the TorchVision transform. kwargs: parameters for the TorchVision transform. """ super().__init__(keys) self.trans = TorchVision(name, *args, **kwargs)
def __init__( self, keys: KeysCollection, name: str, allow_missing_keys: bool = False, *args, **kwargs, ) -> None: """ Args: keys: keys of the corresponding items to be transformed. See also: :py:class:`monai.transforms.compose.MapTransform` name: The transform name in TorchVision package. allow_missing_keys: don't raise exception if key is missing. args: parameters for the TorchVision transform. kwargs: parameters for the TorchVision transform. """ MapTransform.__init__(self, keys, allow_missing_keys) self.trans = TorchVision(name, *args, **kwargs)