mirror of
https://github.com/wassname/IndicoIo-python.git
synced 2026-08-16 11:14:18 +08:00
Fix preprocessing for batch image features
This commit is contained in:
@@ -120,11 +120,13 @@ def normalize(array, distribution=1, norm_range=(0, 1), **kwargs):
|
||||
return dict(zip(keys, norm_array))
|
||||
return norm_array
|
||||
|
||||
def image_preprocess(image):
|
||||
def image_preprocess(image, batch=False):
|
||||
"""
|
||||
Takes an image and prepares it for sending to the api including
|
||||
resizing and image data/structure standardizing.
|
||||
"""
|
||||
if batch:
|
||||
return [image_preprocess(img, batch=False) for img in image]
|
||||
if isinstance(image,list):
|
||||
image = np.asarray(image)
|
||||
if type(image).__module__ != np.__name__:
|
||||
|
||||
Reference in New Issue
Block a user