In [1]:
%matplotlib inline
path = "data/galaxy/sample/"
#path = "data/galaxy/"
train_path = path + 'train/'
valid_path = path + 'valid/'
test_path = path + 'test/'
results_path = path + 'results/'
model_path = path + 'model/'
In [2]:
from utils import *
In [88]:
g = glob(train_path+'images/*.jpg')
img = np.expand_dims(misc.imresize(ndimage.imread(g[12]), (64,64)),axis=0)
img.shape
Out[88]:
In [89]:
plt.imshow(img[0])
Out[89]:
In [90]:
gen = image.ImageDataGenerator(samplewise_center=0,
rotation_range=360,
width_shift_range=0.05,
height_shift_range=0.05,
zoom_range=[0.9,1.3],
horizontal_flip=True,
channel_shift_range=0.5,
dim_ordering='tf')
In [91]:
aug_iter = gen.flow(img, batch_size=1)
aug_imgs = [next(aug_iter)[0] for i in range(8)]
plots(aug_imgs, (20,7), 2)
In [ ]: