Use a Pre-trained Model
Explore how to use the ResNet50 pre-trained model to classify images into numerous categories. Learn how to preprocess input images properly, load the model with ImageNet weights, and interpret prediction outputs. This lesson sets the foundation for building custom classifiers using transfer learning.
We'll cover the following...
We'll cover the following...
Here, we will use the ResNet50 Model. The pre-trained model can classify images into 1000 object categories, such as keyboard, mouse, pencil, animals, etc.
Note that 50 means that the network is 50 layers deep. You can also have a 101 or a 152 layers deep network.
Importing the required libraries
We will import the ResNet50 model from the Keras library. There are many other pre-trained models in the keras.applications module. Check them out here.
Explanation:
- The
preprocess_inputfunction is used to preprocess the input image to the format that theResNet50accepts and has