MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / __call__

Method __call__

PATH/core/data/transforms/seg_transforms_dev.py:483–506  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

get_transformMethod · 0.95
_get_aug_input_argsFunction · 0.70
transformMethod · 0.45

Tested by

no test coverage detected