def get_images_from_request(request_file, names):
"""get pillow images from flask request
@input: request_file: request.files
@input: names: image name list for read
@output: type ndarray. The array obtained by reading the image.
"""
img_list = []
for name in names:
# get upload file
f = request_file.get(name)
if f is None:
continue
img = misc.imread(f)
img_list.append(img)
return img_list
评论列表
文章目录