From cf51a68f1cf12b79f4b8c312a6ec694674832e59 Mon Sep 17 00:00:00 2001 From: IanTayler Date: Mon, 4 Dec 2017 13:22:43 -0300 Subject: [PATCH] Allow greyscale images in prediction. --- luminoth/utils/predicting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luminoth/utils/predicting.py b/luminoth/utils/predicting.py index 9fd29f51..677ed552 100644 --- a/luminoth/utils/predicting.py +++ b/luminoth/utils/predicting.py @@ -36,7 +36,7 @@ def get_predictions(image_paths, config_files): for image_path in image_paths: with tf.gfile.Open(image_path, 'rb') as im_file: try: - image = Image.open(im_file) + image = Image.open(im_file).convert('RGB') except tf.errors.OutOfRangeError as e: yield { 'error': '{}'.format(e),