We will resize the images using the following steps:
- This step is done for the purposes of this book to speed up the model execution time. In a real-world example, this step may not be necessary or desirable. However, knowing how to resize images is helpful in any case. We can resize every image by once again using the map function from the purrr package and also the resizeImage function from the OpenImageR package. In this case, map takes every element from the image_list object and passes it as an argument through the resizeImage function. So, every array will change from having dimensions of 250 x 250 to 50 x 50. We resize every image by running the following code:
image_list <- purrr::map(image_list, ~OpenImageR::resizeImage(., ...