I just make a prediction result like this, but right now I want to save it in .json format
import keras
from keras.models import load_model
from keras.preprocessing import image
import json
import numpy as np
filepath = 'model2.h5'
test_img = 'falling14145853.png'
model = keras.models.load_model(filepath)
img = image.load_img(test_img, target_size=(150, 150))
x = image.img_to_array(img)
x = np.expand_dims(x, axis = 0)
images = np.vstack([x])
classes = model.predict(images, batch_size = 10)
print(test_img)
print(classes)
output
falling14145853.png
[[1. 0. 0.]]