Skip to Content
Deep Learning Quick Reference
book

Deep Learning Quick Reference

by Mike Bernico
March 2018
Intermediate to advanced
272 pages
7h 53m
English
Packt Publishing
Content preview from Deep Learning Quick Reference

Data input

A quick browse of the images should convince you that you that our images all vary in resolution and size. As you know from Chapter 7, Convolutional Neural Networks, however, we will need these images to be a consistent size for our neural network's input tensor. This is a very real-world problem that you'll often face with computer vision tasks. While it's certainly possible to use a program such as ImageMagick (http://www.imagemagick.org) to batch resize our images, the Keras ImageDataGenerator class can be used to resize images on the fly, which is what we will do.

Inception-V3 expects 299 x 299 x 3 images. We can specify this target size in the data generators, as shown in the following code:

train_datagen = ImageDataGenerator( ...
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

Keras Deep Learning Cookbook

Keras Deep Learning Cookbook

Rajdeep Dua, Sujit Pal, Manpreet Singh Ghotra
Deep Learning with Keras

Deep Learning with Keras

Antonio Gulli, Sujit Pal

Publisher Resources

ISBN: 9781788837996Supplemental Content