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 *


Using Theano backend.

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]:
(1, 64, 64, 3)

In [89]:
plt.imshow(img[0])


Out[89]:
<matplotlib.image.AxesImage at 0x7fa684895910>

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 [ ]: