Create a transform, and apply it to augment the input image. This can save you one line of code, when you only care the augmentation of "one image". It will not return the :class:`Transform` object to you so you won't be able to apply the same transformation on
(self, img)
| 181 | apply_coords=lambda coords: legacy_augment_coords(self, coords, p)) |
| 182 | |
| 183 | def augment(self, img): |
| 184 | """ |
| 185 | Create a transform, and apply it to augment the input image. |
| 186 | |
| 187 | This can save you one line of code, when you only care the augmentation of "one image". |
| 188 | It will not return the :class:`Transform` object to you |
| 189 | so you won't be able to apply the same transformation on |
| 190 | other data associated with the image. |
| 191 | |
| 192 | Args: |
| 193 | img (ndarray): see notes of this class on the requirements. |
| 194 | |
| 195 | Returns: |
| 196 | img: augmented image. |
| 197 | """ |
| 198 | check_dtype(img) |
| 199 | t = self.get_transform(img) |
| 200 | return t.apply_image(img) |
| 201 | |
| 202 | # ########################### |
| 203 | # Legacy interfaces: |