Added api error handeling and updated docs

This commit is contained in:
Newmu
2014-09-12 13:12:25 -04:00
parent f1968cf342
commit d6cb1bf1d9
5 changed files with 35 additions and 11 deletions
+2
View File
@@ -93,6 +93,8 @@ def image_preprocess(image):
"""
if isinstance(image,list):
image = np.asarray(image)
if type(image).__module__ != np.__name__:
raise ValueError('Image was not of type numpy.ndarray or list.')
if image.max() > 1:
image = image/255.
if len(image.shape) == 2: