The functionality is as follows:
- The mypath variable sets the path to read all the files from. The training-synthetic folder is specified in this step, as only the files in this folder are going to be used for this chapter.
- The onlyfiles variable is used in order to count all the files under the folder whose path is provided in the previous step by looping through all the files contained in the folder. This will be required in the next step for reading and storing the images.
- The images variable is used to create an empty array of size 3,240 in order to store the images, which are all 200 x 200-pixels.
- Next, by looping through all the files using the onlyfiles variable as an argument in the for loop, each image contained ...