Skip to Content
Mastering Computer Vision with TensorFlow 2.x
book

Mastering Computer Vision with TensorFlow 2.x

by Krishnendu Kar
May 2020
Beginner to intermediate
430 pages
10h 39m
English
Packt Publishing
Content preview from Mastering Computer Vision with TensorFlow 2.x

Importing TensorFlow libraries

Our next step is to import the TensorFlow libraries. The following code imports the ResNet model weights and preprocessed input, similar to what we did in the last section. We learned about each of these concepts in Chapter 5, Neural Network Architecture and Models:

from tensorflow.keras.applications.resnet50 import ResNet50, preprocess_inputfrom tensorflow.keras.layers import Dense, Activation, Flatten, Dropoutfrom tensorflow.keras.models import Sequential, Modelfrom tensorflow.keras.optimizers import SGD, Adamimg_width, img_height = 224, 224

The code also imports several deep learning parameters, such as Dense (a fully connected layer), Activation, Flatten, and Dropout. We then import the Sequential model ...

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.
Start your free trial

You might also like

Hands-On Computer Vision with TensorFlow 2

Hands-On Computer Vision with TensorFlow 2

Benjamin Planche, Eliot Andres

Publisher Resources

ISBN: 9781838827069Supplemental Content