From 3c01ee39ed82da01ae45a0c874e8cebf7afe31f6 Mon Sep 17 00:00:00 2001 From: Tomasz Bieniek <35897213+Bienqq@users.noreply.github.com> Date: Sun, 31 May 2020 13:40:25 +0200 Subject: [PATCH 1/2] Passing seed to get random transform function --- keras_preprocessing/image/iterator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keras_preprocessing/image/iterator.py b/keras_preprocessing/image/iterator.py index f5a9b6cb..ac67595b 100644 --- a/keras_preprocessing/image/iterator.py +++ b/keras_preprocessing/image/iterator.py @@ -234,7 +234,7 @@ def _get_batches_of_transformed_samples(self, index_array): if hasattr(img, 'close'): img.close() if self.image_data_generator: - params = self.image_data_generator.get_random_transform(x.shape) + params = self.image_data_generator.get_random_transform(x.shape, self.seed) x = self.image_data_generator.apply_transform(x, params) x = self.image_data_generator.standardize(x) batch_x[i] = x From 24920102dc957f3e1f703724a5b59c8c09585bd7 Mon Sep 17 00:00:00 2001 From: Tomasz Bieniek <35897213+Bienqq@users.noreply.github.com> Date: Sun, 31 May 2020 13:54:53 +0200 Subject: [PATCH 2/2] Passing seed in numpy array iterator --- keras_preprocessing/image/numpy_array_iterator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keras_preprocessing/image/numpy_array_iterator.py b/keras_preprocessing/image/numpy_array_iterator.py index efd7734b..6f02e3eb 100644 --- a/keras_preprocessing/image/numpy_array_iterator.py +++ b/keras_preprocessing/image/numpy_array_iterator.py @@ -161,7 +161,7 @@ def _get_batches_of_transformed_samples(self, index_array): dtype=self.dtype) for i, j in enumerate(index_array): x = self.x[j] - params = self.image_data_generator.get_random_transform(x.shape) + params = self.image_data_generator.get_random_transform(x.shape, self.seed) x = self.image_data_generator.apply_transform( x.astype(self.dtype), params) x = self.image_data_generator.standardize(x)