DeepVoltaire/AutoAugment

how to use autoaugment.py?

zymize opened this issue · 2 comments

hello,I want to know how to use autoaugment.py? thanks

autoaugment.py uses PIL. Assuming you're stuck on how to feed in (and get out) NumPy arrays, here's an example.

from autoaugment import CIFAR10Policy
from PIL import Image
import numpy as np
transform = CIFAR10Policy()
x = (np.random.rand(100, 100, 3) * 255).astype('uint8')  # fake test image
y = np.array(transform(Image.fromarray(x)))

Thanks @mathandy for answering. :)