How it works...
In step 1, we defined our train and test generators to set the parameters for data augmentation. Then, we loaded the datasets into our environment and simultaneously performed real-time data augmentation while resizing the images to 150 × 150.
In the next step, we instantiated a pre-trained base model, VGG16, with weights trained on ImageNet data. ImageNet is a large visual database that contains images of 1,000 different classes. Note that we had set the value of include_top as FALSE. Setting it to false does not include the default densely connected layers of the VGG16 network, which correspond to 1,000 classes of the ImageNet data. Further, we defined a sequential Keras model that contains the base model along with a few ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access