from PIL import Image img = Image.open("image_file_path").convert('L').resize((28, 28), Image.ANTIALIAS) img = np.array(img) model.predict(img[None,:,:])