How to do it...

We proceed with the recipe as follows:

  1. Import the pre-built models and additional modules needed for processing and showing images:
from keras.applications import ResNet50from keras.applications import InceptionV3from keras.applications import Xception # TensorFlow ONLYfrom keras.applications import VGG16from keras.applications import VGG19from keras.applications import imagenet_utilsfrom keras.applications.inception_v3 import preprocess_inputfrom keras.preprocessing.image import img_to_arrayfrom keras.preprocessing.image import load_imgimport numpy as npimport matplotlib.pyplot as pltfrom matplotlib.pyplot import imshowfrom PIL import Image%matplotlib inline
  1. Define a map used for memorizing the size of images used for ...

Get TensorFlow 1.x Deep Learning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.