Skip to main content

Convenient dataset maker

Project description

Decorata

PyPI version

데코레이타(decorata)는 데이터를 쉽게 전처리 할 수 있는 high-level API library입니다.

Usage

Install

$ pip install decorata

Basic Usage

  1. Base dataset을 선택합니다. Pytorch 기반 데이터셋을 만들려면 TorchBaseDataset을 사용합니다. Tensorflow 기반 데이터셋을 만들려면 TFBaseDataset을 사용합니다.

    import decorata.data as D
    
    dataset = D.TorchBaseDataset(images, labels, classes)
    
  2. decorata.data 안의 모듈을 이용하여 학습 전 데이터를 처리합니다.

    dataset = D.LoadImages(dataset)
    dataset = D.ResizeImages(dataset, (256, 256))
    dataset = D.OneHotLabels(dataset)
    
  3. 데이터 로더를 생성하여 학습에 사용합니다.

    from torch.utils.data import DataLoader
    
    data_loader = DataLoader(
        dataset,
        batch_size = 16,
        shuffle = False,
        num_workers = 4
    )
    

Augmentations

Augmentation은 Albumentations 라이브러리를 이용하도록 설계했습니다.

decorata.data.Augmentations의 인자로 base dataset에서 파생된 인스턴스와 Albumentations 인스턴스를 받습니다.

decorata.augmentations에 Albumentations와 함께 사용할 수 있는 모듈을 추가하고 있습니다.

import albumentations as A
import decorata.data as D
import decorata.augmentations as DA

augmentations = A.Compose([
        A.RandomRotate90(p=1),
        A.GridDistortion(p=0.8),
        A.GaussNoise(p=0.75),
        DA.CutMix(dataset, p=0.8),
])
dataset = D.Augmentations(dataset, augmentations)

Transforms

decorata.data.Transforms를 이용하여 Pytorch의 Transforms를 적용할 수 있습니다.

Augmentation과 동일하게 base dataset에서 파생된 인스턴스와 Albumentations 인스턴스를 인자로 받습니다.

decorata.transforms에 Transforms와 함께 사용할 수 있는 모듈을 추가하고 있습니다.

from torchvision.transforms as T
import decorata.data as D
import decorata.transforms as DT

transforms = T.Compose([
    DT.ToTorchTensor(),
    DT.TorchNormalize(from_image=True)
])
dataset = D.Transforms(dataset, transforms)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

decorata-0.0.1a4.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

decorata-0.0.1a4-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file decorata-0.0.1a4.tar.gz.

File metadata

  • Download URL: decorata-0.0.1a4.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

File hashes

Hashes for decorata-0.0.1a4.tar.gz
Algorithm Hash digest
SHA256 a30d30362fca02d0f9336812f5041a4a2491ec39efd8af6f1dea67bb982a7787
MD5 0f83b24014d9c9002eb05fb356cf5d6d
BLAKE2b-256 764e987072b98081c5999514a52a55ba427199a7d60de3086f0f64168137fe2a

See more details on using hashes here.

File details

Details for the file decorata-0.0.1a4-py3-none-any.whl.

File metadata

  • Download URL: decorata-0.0.1a4-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

File hashes

Hashes for decorata-0.0.1a4-py3-none-any.whl
Algorithm Hash digest
SHA256 ade0cc631dab0305f116c6a40d8790b7fb54b84d55d7b2080bd3c6e51a52f628
MD5 0268f6fcd2aca1634c7d5791bad1e83c
BLAKE2b-256 8976f92c44d1fbe93033de20cd966ce1525a8b8fd619fd2984fac0f179b373f9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page