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

Function apply_augmentations

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

Use ``T.AugmentationList(augmentations)(inputs)`` instead.

(augmentations: List[Union[Transform, Augmentation]], inputs)

Source from the content-addressed store, hash-verified

683
684
685def apply_augmentations(augmentations: List[Union[Transform, Augmentation]], inputs):
686 """
687 Use ``T.AugmentationList(augmentations)(inputs)`` instead.
688 """
689 if isinstance(inputs, np.ndarray):
690 # handle the common case of image-only Augmentation, also for backward compatibility
691 image_only = True
692 inputs = AugInput(inputs)
693 else:
694 image_only = False
695 tfms = inputs.apply_augmentations(augmentations)
696 return inputs.image if image_only else inputs, tfms
697
698
699apply_transform_gens = apply_augmentations

Callers 1

tta_mapperMethod · 0.90

Calls 2

apply_augmentationsMethod · 0.95
AugInputClass · 0.70

Tested by

no test coverage detected