Image processing/Deep-learning

Albumentations 이미지 Augmentation API 소개

유니디니 2021. 1. 31. 19:36
728x90
반응형

이미지 증강방법은 딥러닝이나 컴퓨터 비전에서 학습된 모델의 퀄리티를 향상하기 위해 사용되는 방법이며, 기존 학습데이터를 이용하여 새로운 데이터를 생성하는 목적을 가지고 있다.

 

Pytorch, Tensorflow등 다양한 프레임워크에서 사용 가능하며 pixel-level transforms, spatial-level transforms 등의 70개 연산을 지원한다. 또한, 데이터 타입(RGB-images, grayscale images, multispectral image, segmentation masks, bounding boxes, and keypoints)등 에서 이용 가능한다.

 

 

 

  • Semantic segmentation on the Inria dataset

 

 

  • Medical imaging

 

 

 

  • Object detection and segmentation on the Mapillary Vistas datsets

 

 

  • Key points Augmentation

 

 

 

  • 지원되는 연산

 

 

 

  • Image augmentations 방법의 효과( Validation set 기준 Top-1 Accuracy %)

 

 

 

  • Installation
pip install -U albumentations

 

 

 

  • Simple Examples
import albumentations as A
import cv2

# Declare an augmentation pipeline
transform = A.Compose([
    A.RandomCrop(width=256, height=256),
    A.HorizontalFlip(p=0.5),
    A.RandomBrightnessContrast(p=0.2),
])

# Read an image with OpenCV and convert it to the RGB colorspace
image = cv2.imread("image.jpg")
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)

# Augment an image
transformed = transform(image=image)
transformed_image = transformed["image"]

 

 

[참고 자료] github.com/albumentations-team/albumentations#a-simple-example

반응형