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

Training data generator

Let's have a look at the following code for the training data generator:

from keras.preprocessing.image import ImageDataGeneratortrain_dir = '/home/…/visual_search/furniture_images/train'train_datagen =  ImageDataGenerator(preprocessing_function=preprocess_input,rotation_range=90,horizontal_flip=True,vertical_flip=True)

Flow for directory API—this is used to import data from directories. It has the following parameters:

  • Directory: This is a folder path, and should be set to the path where images for all three classes are present. An example, in this case, would be a path for the train directory. To get the path, you can drag the folder to the Terminal and it will show you the path, which you can then copy and paste. ...
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