FIX: accept PIL Image as input

This commit is contained in:
Chris Lee
2015-06-05 17:18:46 -04:00
parent c82fd16b11
commit d803846cf0
2 changed files with 14 additions and 0 deletions
+2
View File
@@ -107,6 +107,8 @@ def image_preprocess(image, size=(48,48), batch=False):
DeprecationWarning
)
outImage = process_list_image(image)
elif isinstance(image, Image.Image):
outImage = image
elif type(image).__name__ == "ndarray": # image is from numpy/scipy
out_image = Image.fromarray(image)
else: