|
Safemotion Lib
|
Classes | |
| class | AugmentOp |
| class | AugMixAugment |
| class | AutoAugment |
| class | RandAugment |
Functions | |
| _interpolation (kwargs) | |
| _check_args_tf (kwargs) | |
| shear_x (img, factor, **kwargs) | |
| shear_y (img, factor, **kwargs) | |
| translate_x_rel (img, pct, **kwargs) | |
| translate_y_rel (img, pct, **kwargs) | |
| translate_x_abs (img, pixels, **kwargs) | |
| translate_y_abs (img, pixels, **kwargs) | |
| rotate (img, degrees, **kwargs) | |
| auto_contrast (img, **__) | |
| invert (img, **__) | |
| equalize (img, **__) | |
| solarize (img, thresh, **__) | |
| solarize_add (img, add, thresh=128, **__) | |
| posterize (img, bits_to_keep, **__) | |
| contrast (img, factor, **__) | |
| color (img, factor, **__) | |
| brightness (img, factor, **__) | |
| sharpness (img, factor, **__) | |
| _randomly_negate (v) | |
| _rotate_level_to_arg (level, _hparams) | |
| _enhance_level_to_arg (level, _hparams) | |
| _enhance_increasing_level_to_arg (level, _hparams) | |
| _shear_level_to_arg (level, _hparams) | |
| _translate_abs_level_to_arg (level, hparams) | |
| _translate_rel_level_to_arg (level, hparams) | |
| _posterize_level_to_arg (level, _hparams) | |
| _posterize_increasing_level_to_arg (level, hparams) | |
| _posterize_original_level_to_arg (level, _hparams) | |
| _solarize_level_to_arg (level, _hparams) | |
| _solarize_increasing_level_to_arg (level, _hparams) | |
| _solarize_add_level_to_arg (level, _hparams) | |
| auto_augment_policy_v0 (hparams) | |
| auto_augment_policy_v0r (hparams) | |
| auto_augment_policy_original (hparams) | |
| auto_augment_policy_originalr (hparams) | |
| auto_augment_policy (name="original") | |
| auto_augment_transform (config_str, hparams) | |
| _select_rand_weights (weight_idx=0, transforms=None) | |
| rand_augment_ops (magnitude=10, hparams=None, transforms=None) | |
| rand_augment_transform (config_str, hparams) | |
| augmix_ops (magnitude=10, hparams=None, transforms=None) | |
| augment_and_mix_transform (config_str, hparams) | |
Variables | |
| _PIL_VER = tuple([int(x) for x in PIL.__version__.split('.')[:2]]) | |
| tuple | _FILL = (128, 128, 128) |
| int | _MAX_LEVEL = 10. |
| _HPARAMS_DEFAULT | |
| tuple | _RANDOM_INTERPOLATION = (Image.BILINEAR, Image.BICUBIC) |
| dict | LEVEL_TO_ARG |
| dict | NAME_TO_OP |
| list | _RAND_TRANSFORMS |
| dict | _RAND_CHOICE_WEIGHTS_0 |
| list | _AUGMIX_TRANSFORMS |
@author: liaoxingyu @contact: sherlockliao01@gmail.com
|
protected |
Definition at line 53 of file autoaugment.py.
|
protected |
Definition at line 193 of file autoaugment.py.
|
protected |
Definition at line 188 of file autoaugment.py.
|
protected |
Definition at line 45 of file autoaugment.py.
|
protected |
Definition at line 230 of file autoaugment.py.
|
protected |
Definition at line 223 of file autoaugment.py.
|
protected |
Definition at line 237 of file autoaugment.py.
|
protected |
With 50% prob, negate the value
Definition at line 176 of file autoaugment.py.
|
protected |
Definition at line 181 of file autoaugment.py.
|
protected |
Definition at line 600 of file autoaugment.py.
|
protected |
Definition at line 201 of file autoaugment.py.
|
protected |
Definition at line 256 of file autoaugment.py.
|
protected |
Definition at line 250 of file autoaugment.py.
|
protected |
Definition at line 244 of file autoaugment.py.
|
protected |
Definition at line 208 of file autoaugment.py.
|
protected |
Definition at line 215 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.augment_and_mix_transform | ( | config_str, | |
| hparams ) |
Create AugMix PyTorch transform
:param config_str: String defining configuration of random augmentation. Consists of multiple sections separated by
dashes ('-'). The first section defines the specific variant of rand augment (currently only 'rand'). The remaining
sections, not order sepecific determine
'm' - integer magnitude (severity) of augmentation mix (default: 3)
'w' - integer width of augmentation chain (default: 3)
'd' - integer depth of augmentation chain (-1 is random [1, 3], default: -1)
'b' - integer (bool), blend each branch of chain into end result without a final blend, less CPU (default: 0)
'mstd' - float std deviation of magnitude noise applied (default: 0)
Ex 'augmix-m5-w4-d2' results in AugMix with severity 5, chain width 4, chain depth 2
:param hparams: Other hparams (kwargs) for the Augmentation transforms
:return: A PyTorch compatible Transform
Definition at line 769 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.augmix_ops | ( | magnitude = 10, | |
| hparams = None, | |||
| transforms = None ) |
Definition at line 695 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.auto_augment_policy | ( | name = "original" | ) |
Definition at line 481 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.auto_augment_policy_original | ( | hparams | ) |
Definition at line 415 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.auto_augment_policy_originalr | ( | hparams | ) |
Definition at line 448 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.auto_augment_policy_v0 | ( | hparams | ) |
Definition at line 348 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.auto_augment_policy_v0r | ( | hparams | ) |
Definition at line 381 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.auto_augment_transform | ( | config_str, | |
| hparams ) |
Create a AutoAugment transform
:param config_str: String defining configuration of auto augmentation. Consists of multiple sections separated by
dashes ('-'). The first section defines the AutoAugment policy (one of 'v0', 'v0r', 'original', 'originalr').
The remaining sections, not order sepecific determine
'mstd' - float std deviation of magnitude noise applied
Ex 'original-mstd0.5' results in AutoAugment with original policy, magnitude_std 0.5
:param hparams: Other hparams (kwargs) for the AutoAugmentation scheme
:return: A PyTorch compatible Transform
Definition at line 513 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.auto_contrast | ( | img, | |
| ** | __ ) |
Definition at line 123 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.brightness | ( | img, | |
| factor, | |||
| ** | __ ) |
Definition at line 168 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.color | ( | img, | |
| factor, | |||
| ** | __ ) |
Definition at line 164 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.contrast | ( | img, | |
| factor, | |||
| ** | __ ) |
Definition at line 160 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.equalize | ( | img, | |
| ** | __ ) |
Definition at line 131 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.invert | ( | img, | |
| ** | __ ) |
Definition at line 127 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.posterize | ( | img, | |
| bits_to_keep, | |||
| ** | __ ) |
Definition at line 154 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.rand_augment_ops | ( | magnitude = 10, | |
| hparams = None, | |||
| transforms = None ) |
Definition at line 609 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.rand_augment_transform | ( | config_str, | |
| hparams ) |
Create a RandAugment transform
:param config_str: String defining configuration of random augmentation. Consists of multiple sections separated by
dashes ('-'). The first section defines the specific variant of rand augment (currently only 'rand'). The remaining
sections, not order sepecific determine
'm' - integer magnitude of rand augment
'n' - integer num layers (number of transform ops selected per image)
'w' - integer probabiliy weight index (index of a set of weights to influence choice of op)
'mstd' - float std deviation of magnitude noise applied
'inc' - integer (bool), use augmentations that increase in severity with magnitude (default: 0)
Ex 'rand-m9-n3-mstd0.5' results in RandAugment with magnitude 9, num_layers 3, magnitude_std 0.5
'rand-mstd1-w0' results in magnitude_std 1.0, weights 0, default magnitude of 10 and num_layers 2
:param hparams: Other hparams (kwargs) for the RandAugmentation scheme
:return: A PyTorch compatible Transform
Definition at line 631 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.rotate | ( | img, | |
| degrees, | |||
| ** | kwargs ) |
Definition at line 91 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.sharpness | ( | img, | |
| factor, | |||
| ** | __ ) |
Definition at line 172 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.shear_x | ( | img, | |
| factor, | |||
| ** | kwargs ) |
Definition at line 59 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.shear_y | ( | img, | |
| factor, | |||
| ** | kwargs ) |
Definition at line 64 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.solarize | ( | img, | |
| thresh, | |||
| ** | __ ) |
Definition at line 135 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.solarize_add | ( | img, | |
| add, | |||
| thresh = 128, | |||
| ** | __ ) |
Definition at line 139 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.translate_x_abs | ( | img, | |
| pixels, | |||
| ** | kwargs ) |
Definition at line 81 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.translate_x_rel | ( | img, | |
| pct, | |||
| ** | kwargs ) |
Definition at line 69 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.translate_y_abs | ( | img, | |
| pixels, | |||
| ** | kwargs ) |
Definition at line 86 of file autoaugment.py.
| fastreid.data.transforms.autoaugment.translate_y_rel | ( | img, | |
| pct, | |||
| ** | kwargs ) |
Definition at line 75 of file autoaugment.py.
|
protected |
Definition at line 678 of file autoaugment.py.
|
protected |
Definition at line 31 of file autoaugment.py.
|
protected |
Definition at line 37 of file autoaugment.py.
|
protected |
Definition at line 35 of file autoaugment.py.
|
protected |
Definition at line 29 of file autoaugment.py.
|
protected |
Definition at line 581 of file autoaugment.py.
|
protected |
Definition at line 541 of file autoaugment.py.
|
protected |
Definition at line 42 of file autoaugment.py.
| dict fastreid.data.transforms.autoaugment.LEVEL_TO_ARG |
Definition at line 261 of file autoaugment.py.
| dict fastreid.data.transforms.autoaugment.NAME_TO_OP |
Definition at line 289 of file autoaugment.py.