Skip to content

Commit e555b39

Browse files
committed
Lint Code
1 parent 89f4abe commit e555b39

34 files changed

+681
-1154
lines changed

ptsemseg/augmentations.py

Lines changed: 0 additions & 195 deletions
This file was deleted.

ptsemseg/augmentations/__init__.py

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,41 @@
11
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+
)
319

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+
}
538

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,}
2039

2140
def get_composed_augmentations(aug_dict):
2241
if aug_dict is None:
@@ -28,5 +47,3 @@ def get_composed_augmentations(aug_dict):
2847
augmentations.append(key2aug[aug_key](aug_param))
2948
logger.info("Using {} aug with params {}".format(aug_key, aug_param))
3049
return Compose(augmentations)
31-
32-

0 commit comments

Comments
 (0)