You can follow along with the code in the Jupyter notebook ch-12a_VGG16_Keras.
Now let us do the same classification and retraining with Keras. You will see how easily we can use the VGG16 pre-trained model in Keras with the lesser amount of code.
You can follow along with the code in the Jupyter notebook ch-12a_VGG16_Keras.
Now let us do the same classification and retraining with Keras. You will see how easily we can use the VGG16 pre-trained model in Keras with the lesser amount of code.
Loading the model is a one-line operation:
from keras.applications import VGG16
model=VGG16(weights='imagenet')
We can use this model to predict the probabilities of classes:
probs = model.predict(images_test)
Here are the results of this classification:
Input image | Output probabilities |
Probability 99.41% of [zebra] Probability 0.19% of [tiger cat] Probability 0.13% of [goose] Probability 0.09... |