use*_*457 3 python numpy keras
我存储的numpy数组包含一个图像.图像的大小为23.4 KB,但.npy文件的大小为4 MB
import numpy as np
from keras.preprocessing.image import load_img,img_to_array
image=load_img('image.JPEG')
array=img_to_array(image)
np.save('sample.npy',array)
Run Code Online (Sandbox Code Playgroud)