From 3d80c0ab9080ad2364d40112332a418b5e85dc95 Mon Sep 17 00:00:00 2001 From: charlesbensimon Date: Thu, 15 Feb 2018 11:36:41 +0100 Subject: [PATCH] Omniglot resize - Fix image mode for the resample to be effective In the omniglot dataset, images are in black and white mode. When resizing in that mode, resampling is useless as gray tones are not allowed. As you specified a resample method, I think that this was not intended --- data/omniglot_resized/resize_images.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/omniglot_resized/resize_images.py b/data/omniglot_resized/resize_images.py index 769ee3135..7123e74fd 100644 --- a/data/omniglot_resized/resize_images.py +++ b/data/omniglot_resized/resize_images.py @@ -20,7 +20,7 @@ for image_file in all_images: im = Image.open(image_file) - im = im.resize((28,28), resample=Image.LANCZOS) + im = im.convert('L').resize((28,28), resample=Image.LANCZOS) im.save(image_file) i += 1