Args: name: The transform name in TorchVision package. args: parameters for the TorchVision transform. kwargs: parameters for the TorchVision transform.
(self, name: str, *args, **kwargs)
| 1153 | backend = [TransformBackends.TORCH] |
| 1154 | |
| 1155 | def __init__(self, name: str, *args, **kwargs) -> None: |
| 1156 | """ |
| 1157 | Args: |
| 1158 | name: The transform name in TorchVision package. |
| 1159 | args: parameters for the TorchVision transform. |
| 1160 | kwargs: parameters for the TorchVision transform. |
| 1161 | |
| 1162 | """ |
| 1163 | super().__init__() |
| 1164 | self.name = name |
| 1165 | transform, _ = optional_import("torchvision.transforms", "0.8.0", min_version, name=name) |
| 1166 | self.trans = transform(*args, **kwargs) |
| 1167 | |
| 1168 | def __call__(self, img: NdarrayOrTensor): |
| 1169 | """ |
nothing calls this directly
no test coverage detected