1
1
import logging
2
- from ptsemseg .augmentations .augmentations import *
2
+ from ptsemseg .augmentations .augmentations import (
3
+ AdjustContrast ,
4
+ AdjustGamma ,
5
+ AdjustBrightness ,
6
+ AdjustSaturation ,
7
+ AdjustHue ,
8
+ RandomCrop ,
9
+ RandomHorizontallyFlip ,
10
+ RandomVerticallyFlip ,
11
+ Scale ,
12
+ RandomSized ,
13
+ RandomSizedCrop ,
14
+ RandomRotate ,
15
+ RandomTranslate ,
16
+ CenterCrop ,
17
+ Compose ,
18
+ )
3
19
4
- logger = logging .getLogger ('ptsemseg' )
20
+ logger = logging .getLogger ("ptsemseg" )
21
+
22
+ key2aug = {
23
+ "gamma" : AdjustGamma ,
24
+ "hue" : AdjustHue ,
25
+ "brightness" : AdjustBrightness ,
26
+ "saturation" : AdjustSaturation ,
27
+ "contrast" : AdjustContrast ,
28
+ "rcrop" : RandomCrop ,
29
+ "hflip" : RandomHorizontallyFlip ,
30
+ "vflip" : RandomVerticallyFlip ,
31
+ "scale" : Scale ,
32
+ "rsize" : RandomSized ,
33
+ "rsizecrop" : RandomSizedCrop ,
34
+ "rotate" : RandomRotate ,
35
+ "translate" : RandomTranslate ,
36
+ "ccrop" : CenterCrop ,
37
+ }
5
38
6
- key2aug = {'gamma' : AdjustGamma ,
7
- 'hue' : AdjustHue ,
8
- 'brightness' : AdjustBrightness ,
9
- 'saturation' : AdjustSaturation ,
10
- 'contrast' : AdjustContrast ,
11
- 'rcrop' : RandomCrop ,
12
- 'hflip' : RandomHorizontallyFlip ,
13
- 'vflip' : RandomVerticallyFlip ,
14
- 'scale' : Scale ,
15
- 'rsize' : RandomSized ,
16
- 'rsizecrop' : RandomSizedCrop ,
17
- 'rotate' : RandomRotate ,
18
- 'translate' : RandomTranslate ,
19
- 'ccrop' : CenterCrop ,}
20
39
21
40
def get_composed_augmentations (aug_dict ):
22
41
if aug_dict is None :
@@ -28,5 +47,3 @@ def get_composed_augmentations(aug_dict):
28
47
augmentations .append (key2aug [aug_key ](aug_param ))
29
48
logger .info ("Using {} aug with params {}" .format (aug_key , aug_param ))
30
49
return Compose (augmentations )
31
-
32
-
0 commit comments