from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img
datagen = ImageDataGenerator(rescale=1. / 255)
img = load_img('C:/Users/pikro/OneDrive/Рабочий стол/dogs_vs_cats/test1/334.jpg') # this is a PIL image
img = img.resize((150, 150))
x = img_to_array(img) # this is a Numpy array with shape (3, 150, 150)
x = x.reshape((1,) + x.shape) # this is a Numpy array with shape (1, 3, 150, 150)
i = 0
for batch in datagen.flow(x, batch_size=1):
print(model.predict(batch))
i += 1
if i >= 1:
break