提交 162a99c0 编写于 作者: T Tao Luo 提交者: GitHub

Merge pull request #60 from qingqing01/develop

bug fix for image_classification
...@@ -188,7 +188,9 @@ def process(settings, file_list): ...@@ -188,7 +188,9 @@ def process(settings, file_list):
labels = batch['labels'] labels = batch['labels']
for im, lab in zip(images, labels): for im, lab in zip(images, labels):
if settings.is_train and np.random.randint(2): if settings.is_train and np.random.randint(2):
im = im.reshape(3, 32, 32)
im = im[:,:,::-1] im = im[:,:,::-1]
im = im.flatten()
im = im - settings.mean im = im - settings.mean
yield { yield {
'image': im.astype('float32'), 'image': im.astype('float32'),
......
...@@ -38,6 +38,8 @@ def process(settings, file_list): ...@@ -38,6 +38,8 @@ def process(settings, file_list):
labels = batch['labels'] labels = batch['labels']
for im, lab in zip(images, labels): for im, lab in zip(images, labels):
if settings.is_train and np.random.randint(2): if settings.is_train and np.random.randint(2):
im = im.reshape(3, 32, 32)
im = im[:, :, ::-1] im = im[:, :, ::-1]
im = im.flatten()
im = im - settings.mean im = im - settings.mean
yield {'image': im.astype('float32'), 'label': int(lab)} yield {'image': im.astype('float32'), 'label': int(lab)}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册