MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / __init__

Method __init__

monai/transforms/utility/array.py:1155–1166  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers

nothing calls this directly

Calls 2

optional_importFunction · 0.90
__init__Method · 0.45

Tested by

no test coverage detected