A transform that does nothing.
| 133 | |
| 134 | |
| 135 | class NoOpTransform(Transform): |
| 136 | """ |
| 137 | A transform that does nothing. |
| 138 | """ |
| 139 | |
| 140 | def __init__(self): |
| 141 | super().__init__() |
| 142 | |
| 143 | def apply_image(self, img: np.ndarray) -> np.ndarray: |
| 144 | return img |
| 145 | |
| 146 | def apply_coords(self, coords: np.ndarray) -> np.ndarray: |
| 147 | return coords |
| 148 | |
| 149 | def inverse(self) -> Transform: |
| 150 | return self |
| 151 | |
| 152 | def __getattr__(self, name: str): |
| 153 | if name.startswith("apply_"): |
| 154 | return lambda x: x |
| 155 | raise AttributeError("NoOpTransform object has no attribute {}".format(name)) |
| 156 | |
| 157 | |
| 158 | class CropTransform(Transform): |
no outgoing calls
no test coverage detected