Do nothing to the data. As the output value is same as input, it can be used as a testing tool to verify the transform chain, Compose or transform adaptor, etc.
| 115 | |
| 116 | |
| 117 | class Identity(Transform): |
| 118 | """ |
| 119 | Do nothing to the data. |
| 120 | As the output value is same as input, it can be used as a testing tool to verify the transform chain, |
| 121 | Compose or transform adaptor, etc. |
| 122 | """ |
| 123 | |
| 124 | backend = [TransformBackends.TORCH, TransformBackends.NUMPY] |
| 125 | |
| 126 | def __call__(self, img: NdarrayOrTensor) -> NdarrayOrTensor: |
| 127 | """ |
| 128 | Apply the transform to `img`. |
| 129 | """ |
| 130 | return img |
| 131 | |
| 132 | |
| 133 | class RandIdentity(RandomizableTrait): |
no outgoing calls
searching dependent graphs…