티스토리 뷰

1. Albumentations란?

Image Augmentation를 지원해주는 일종의 라이브러리다. [2]논문에 따르면 torchvision이나, Keras, imgaug보다 

Albumentations이 빠른 속도를 지원해준다고 나와있다. 이때 숫자는 낮으면 낮을수록 좋다. 

[3]에 따르면 Albumentations의 장점은 1. fast, 2. Flexible, 3. Diverse 하다. 

 

 

 

[2] Albumentations: fast and flexible image augmentations

 

2. 설치방법? 

- 하단의 [1] 출처에 가면 PyPI 및 Conda 환경일때 어떻게 설치하는지 나와있다. 

 

 

3. 사용방법

@rwightman의 github에서 발췌해왔다. 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import albumentations as A
 
def get_train_transforms():
    return A.Compose(
        [
            A.RandomSizedCrop(min_max_height=(800800), height=1024, width=1024, p=0.5),
            A.OneOf([
                A.HueSaturationValue(hue_shift_limit=0.2, sat_shift_limit= 0.2
                                     val_shift_limit=0.2, p=0.9),
                A.RandomBrightnessContrast(brightness_limit=0.2
                                           contrast_limit=0.2, p=0.9),
            ],p=0.9),
            A.ToGray(p=0.01),
            A.HorizontalFlip(p=0.5),
            A.VerticalFlip(p=0.5),
            A.Resize(height=512, width=512, p=1),
            A.Cutout(num_holes=8, max_h_size=64, max_w_size=64, fill_value=0, p=0.5),
            ToTensorV2(p=1.0),
        ], 
        p=1.0
        bbox_params=A.BboxParams(
            format='pascal_voc',
            min_area=0
            min_visibility=0,
            label_fields=['labels']
        )
    )
 
def get_valid_transforms():
    return A.Compose(
        [
            A.Resize(height=512, width=512, p=1.0),
            ToTensorV2(p=1.0),
        ], 
        p=1.0
        bbox_params=A.BboxParams(
            format='pascal_voc',
            min_area=0
            min_visibility=0,
            label_fields=['labels']
        )
    )
cs

 

 

 

 

<출처>

[1] https://github.com/albumentations-team/albumentations

 

albumentations-team/albumentations

fast image augmentation library and easy to use wrapper around other libraries - albumentations-team/albumentations

github.com

[2] Buslaev, A., Iglovikov, V. I., Khvedchenya, E., Parinov, A., Druzhinin, M., & Kalinin, A. A. (2020). Albumentations: fast and flexible image augmentations. Information, 11(2), 125.

[3] https://www.kaggle.com/c/tgs-salt-identification-challenge/discussion/66643

[4] 

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG more
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함