Image augmentation auxiliary tool
Project description
AugWrap
Installation
$ pip install augwrap
Basic Usage
-
Base dataset을 선택합니다. Pytorch 기반 데이터셋을 만들려면
TorchBaseDataset을 사용합니다. Tensorflow 기반 데이터셋을 만들려면TFBaseDataset을 사용합니다.import augwrap as aw dataset = aw.data.TorchBaseDataset(images, labels, classes)
-
augwrap.data안의 모듈을 이용하여 학습 전 데이터를 처리합니다.dataset = aw.data.LoadImages(dataset) dataset = aw.data.ResizeImages(dataset, (256, 256)) dataset = aw.data.OneHotLabels(dataset)
-
데이터 로더를 생성하여 학습에 사용합니다.
from torch.utils.data import DataLoader data_loader = DataLoader( dataset, batch_size = 16, shuffle = False, num_workers = 4 )
Augmentations
잘 알려진 어그멘테이션 도구인 Albumentations을 활용할 수 있도록 만들었습니다.
augwrap.data.Augmentations의 생성자 인자로 base dataset에서 파생된 객체와 Albumentations 객체를 받습니다.
Albumentations와 함께 사용할 수 있는 어그멘테이션 모듈을 augwrap.augmentations에 추가했습니다.
import albumentations as A
import augwrap as aw
augmentations = A.Compose([
A.RandomRotate90(p=1),
A.GridDistortion(p=0.8),
A.GaussNoise(p=0.75),
aw.augmentations.CutMix(dataset, p=0.8),
])
dataset = aw.data.Augmentations(dataset, augmentations)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file augwrap-0.0.1a2.tar.gz.
File metadata
- Download URL: augwrap-0.0.1a2.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09481c4aed6dbe17a553b686c80f44ff5e7e05d5a8b305f076c615fc745516b4
|
|
| MD5 |
5902fafff20470770d302ab3032ba34c
|
|
| BLAKE2b-256 |
cc8b8e374ea8b6935bc521458cda1d90b5b7e3e418b0fc10f0e51fc78a43500d
|
File details
Details for the file augwrap-0.0.1a2-py3-none-any.whl.
File metadata
- Download URL: augwrap-0.0.1a2-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b28f7166e13432a31ab3bbc0622138d03d88b3351e70d7a5c693c860d7fc719
|
|
| MD5 |
f904e64976f0196c3d238b2e5c01b46b
|
|
| BLAKE2b-256 |
55383440093b1e62d997c18a5e364287f456200e96e9c2738aaebe908477eed2
|