def prepare_image(_image_src, target_size):
'''
Takes image source as input as return
processed image array ready for train/test/val
:param _image_src: source of image
:return: image_array
'''
img = image.load_img(_image_src, size = target_size)
x = image.img_to_array(img)
x = np.expand_dims(x, axis=0)
x = preprocess_input(x)
return x
data_preparation.py 文件源码
python
阅读 31
收藏 0
点赞 0
评论 0
评论列表
文章目录