From c883d9e59933ae387a1cc12e1cf867fdd4694e87 Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Fri, 10 Jan 2014 09:59:02 +0000 Subject: [PATCH] Image is a PIL requirement and should only be imported when actually using it --- GPy/util/visualize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPy/util/visualize.py b/GPy/util/visualize.py index ecdf78ce..7645ec40 100644 --- a/GPy/util/visualize.py +++ b/GPy/util/visualize.py @@ -4,7 +4,6 @@ import GPy import numpy as np import matplotlib as mpl import time -import Image try: import visual visual_available = True @@ -323,6 +322,7 @@ class image_show(matplotlib_show): else: self.vals = 255*(self.vals - self.vals.min())/(self.vals.max() - self.vals.min()) if not self.palette == []: # applying using an image palette (e.g. if the image has been quantized) + from PIL import Image self.vals = Image.fromarray(self.vals.astype('uint8')) self.vals.putpalette(self.palette) # palette is a list, must be loaded before calling this function