test.py 604 Bytes
from keras.models import load_model
from keras.datasets import fashion_mnist
import matplotlib.pyplot as plt
import os

MODEL_SAVE_FOLDER_PATH = os.path.join(os.getcwd(), 'trained')
MODEL_SAVE_PATH = MODEL_SAVE_FOLDER_PATH + '/seresnext_cifar10.h5'
TEST_IMAGE_FOLDER_PATH = os.path.join(os.getcwd(), 'test')
TEST_IMAGE_PATH = TEST_IMAGE_FOLDER_PATH + '/test01.png'

model = load_model('MODEL_SAVE_PATH')
(train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data()
model.predict(test_images[:1, :])
model.predict_classes(test_images[:1, :], verbose=0)

plt.imshow(test_images[0])