text_plain_output_1.png image_output_1.png
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
numImages = 16
fig = plt.figure(figsize=(7, 7))
imgData = np.zeros(shape=(numImages, 36963))
for i in range(1, numImages + 1):
    filename = '../input/foodpics/pics/Picture' + str(i) + '.jpg'
    img = mpimg.imread(filename)
    ax = fig.add_subplot(4, 4, i)
    plt.imshow(img)
    plt.axis('off')
    ax.set_title(str(i))
    imgData[i - 1] = np.array(img.flatten()).reshape(1, img.shape[0] * img.shape[1] * img.shape[2])