
unzip('example_images.zip');
data_path = 'example_images';
addpath 'example_images';
numRow = 3;
numImages = 5;
file_path = dir(data_path);
pic_path = cell(1, numImages*numRow);

imgFilesArray = [];
ind = 2+randi(length(file_path)-2);

for sec = 1:numRow
    imgFilesArraySingle = [];
    for i=1:numImages
        file = file_path((sec-1)*numImages+i+2);
        imgFile = imread(file.name);
        imgFile = imresize(imgFile, [227 227]);
        imgFilesArraySingle = cat(2, imgFilesArraySingle, imgFile);
    end
    imgFilesArray = cat(1, imgFilesArray, imgFilesArraySingle);
end

% concatenate images into a 4D matrix
img = [];
for i=1:numImages*numRow
    %im = prepareImage(pic_names{i});
    im = imread(file_path(i+2).name);
    im = single(imresize(im, [227 227]));
    img = cat(4, img, im);
end

figure(1);
imshow(imgFilesArray);

results = hW.predict(img, 'Profile', 'off');

annotateResults;

