March 2019
Intermediate to advanced
642 pages
22h 54m
English
Now, we will use a pretrained model to classify a single image; in this section, we will explain the code step by step:
from keras.applications.resnet50 import ResNet50from keras.preprocessing import imagefrom keras.applications.resnet50 import preprocess_input, decode_predictionsimport numpy as np
PTModel = ResNet50(weights='imagenet')
ImgPath = 'airplane.jpg'Img = image.load_img(ImgPath, target_size=(224, 224))
Read now
Unlock full access