From 365557a2fc3b6fb4747ffa548d96ba431ccec876 Mon Sep 17 00:00:00 2001 From: Admin Date: Thu, 25 Jan 2018 16:11:35 +0100 Subject: [PATCH 1/3] Minor change: Added tif and tiff to white_list_formats --- keras/preprocessing/image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keras/preprocessing/image.py b/keras/preprocessing/image.py index 4d951ac4d0e..7be762747af 100644 --- a/keras/preprocessing/image.py +++ b/keras/preprocessing/image.py @@ -1094,7 +1094,7 @@ def __init__(self, directory, image_data_generator, self.save_format = save_format self.interpolation = interpolation - white_list_formats = {'png', 'jpg', 'jpeg', 'bmp', 'ppm'} + white_list_formats = {'png', 'jpg', 'jpeg', 'bmp', 'ppm', 'tif', 'tiff'} # first, count the number of samples and classes self.samples = 0 From 031c725d741fb279ec09ed4e03b92b34352f2478 Mon Sep 17 00:00:00 2001 From: Admin Date: Fri, 26 Jan 2018 17:21:29 +0100 Subject: [PATCH 2/3] UserWarning message for tiff images added --- keras/preprocessing/image.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/keras/preprocessing/image.py b/keras/preprocessing/image.py index 7be762747af..8ca0a40798f 100644 --- a/keras/preprocessing/image.py +++ b/keras/preprocessing/image.py @@ -963,6 +963,9 @@ def _recursive_list(subpath): for fname in files: is_valid = False for extension in white_list_formats: + if fname.lower().endswith('.tiff'): + warnings.warn('Using \'.tiff\' files with multiple bands will cause distortion.' + 'Please verify your output.') if fname.lower().endswith('.' + extension): is_valid = True break From ecb730ce5ddc31d413f910a7533186b10bb7a70c Mon Sep 17 00:00:00 2001 From: bill Date: Sat, 27 Jan 2018 14:51:11 +0100 Subject: [PATCH 3/3] Space between sentences added --- keras/preprocessing/image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keras/preprocessing/image.py b/keras/preprocessing/image.py index 8ca0a40798f..d943a2db662 100644 --- a/keras/preprocessing/image.py +++ b/keras/preprocessing/image.py @@ -964,7 +964,7 @@ def _recursive_list(subpath): is_valid = False for extension in white_list_formats: if fname.lower().endswith('.tiff'): - warnings.warn('Using \'.tiff\' files with multiple bands will cause distortion.' + warnings.warn('Using \'.tiff\' files with multiple bands will cause distortion. ' 'Please verify your output.') if fname.lower().endswith('.' + extension): is_valid = True