Commit 0ad99a75 authored by Laanait, Nouamane's avatar Laanait, Nouamane

adding random crop option

parent 2b787e5e
......@@ -548,10 +548,13 @@ class DatasetLMDB(DatasetTFRecords):
# data augmentation
if self.params[self.mode + '_distort']:
with tf.device('/gpu:%i' % hvd.local_rank()):
images = tf.transpose(images, perm=[0,2,3,1])
images = self.random_crop_resize(images)
images = self.add_noise_image(images)
images = tf.transpose(images, perm=[0,3,1,2])
if self.params['random_crop']:
images = tf.transpose(images, perm=[0,2,3,1])
images = self.random_crop_resize(images)
images = self.add_noise_image(images)
images = tf.transpose(images, perm=[0,3,1,2])
else:
images = self.add_noise_image(images)
return images, labels
def get_glimpses(self, batch_images):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment