Augment the given `aug_input` **in-place**, and return the transform that's used. This method will be called to apply the augmentation. In most augmentation, it is enough to use the default implementation, which calls :meth:`get_transform` using the inputs. But a su
(self, aug_input)
| 481 | raise NotImplementedError |
| 482 | |
| 483 | def __call__(self, aug_input) -> Transform: |
| 484 | """ |
| 485 | Augment the given `aug_input` **in-place**, and return the transform that's used. |
| 486 | |
| 487 | This method will be called to apply the augmentation. In most augmentation, it |
| 488 | is enough to use the default implementation, which calls :meth:`get_transform` |
| 489 | using the inputs. But a subclass can overwrite it to have more complicated logic. |
| 490 | |
| 491 | Args: |
| 492 | aug_input (AugInput): an object that has attributes needed by this augmentation |
| 493 | (defined by ``self.get_transform``). Its ``transform`` method will be called |
| 494 | to in-place transform it. |
| 495 | |
| 496 | Returns: |
| 497 | Transform: the transform that is applied on the input. |
| 498 | """ |
| 499 | args = _get_aug_input_args(self, aug_input) |
| 500 | tfm = self.get_transform(*args) |
| 501 | assert isinstance(tfm, (Transform, TransformList)), ( |
| 502 | f"{type(self)}.get_transform must return an instance of Transform! " |
| 503 | f"Got {type(tfm)} instead." |
| 504 | ) |
| 505 | aug_input.transform(tfm) |
| 506 | return tfm |
| 507 | |
| 508 | def _rand_range(self, low=1.0, high=None, size=None): |
| 509 | """ |
nothing calls this directly
no test coverage detected