mmagic.datasets.transforms.albumentations
¶
Module Contents¶
Classes¶
Albumentation augmentation. |
Attributes¶
- class mmagic.datasets.transforms.albumentations.Albumentations(keys: List[str], transforms: List[dict])[source]¶
Bases:
mmcv.transforms.BaseTransform
Albumentation augmentation.
Adds custom transformations from Albumentations library. Please, visit https://github.com/albumentations-team/albumentations and https://albumentations.ai/docs/getting_started/transforms_and_targets to get more information.
An example of
transforms
is as followed:albu_transforms = [ dict( type='Resize', height=100, width=100, ), dict( type='RandomFog', p=0.5, ), dict( type='RandomRain', p=0.5 ), dict( type='RandomSnow', p=0.5, ), ] pipeline = [ dict( type='LoadImageFromFile', key='img', color_type='color', channel_order='rgb', imdecode_backend='cv2'), dict( type='Albumentations', keys=['img'], transforms=albu_transforms), dict(type='PackInputs') ]
- Parameters
keys (list[str]) – A list specifying the keys whose values are modified.
transforms (list[dict]) – A list of albu transformations.