February 2020
Intermediate to advanced
328 pages
8h 19m
English
We will use the flow_images_from_directory() function from keras to read and manipulate data on the fly.
# Reading train datatrain_data <- flow_images_from_directory(directory = train_path, target_size = img_size, color_mode = "rgb", class_mode = "categorical", classes = class_label, batch_size = 20)# Reading test datatest_data <- flow_images_from_directory(directory = test_path, target_size = img_size, color_mode = "rgb", class_mode = "categorical", classes = class_label, batch_size = 20)
Let's see how many images we have in train and test sets:
print(paste("Number of images in train and test is",train_data$n,"and ",test_data$n,"repectively")) ...Read now
Unlock full access