Reader small image

You're reading from  Advanced Deep Learning with TensorFlow 2 and Keras - Second Edition

Product typeBook
Published inFeb 2020
Reading LevelIntermediate
PublisherPackt
ISBN-139781838821654
Edition2nd Edition
Languages
Right arrow
Author (1)
Rowel Atienza
Rowel Atienza
author image
Rowel Atienza

Rowel Atienza is an Associate Professor at the Electrical and Electronics Engineering Institute of the University of the Philippines, Diliman. He holds the Dado and Maria Banatao Institute Professorial Chair in Artificial Intelligence. Rowel has been fascinated with intelligent robots since he graduated from the University of the Philippines. He received his MEng from the National University of Singapore for his work on an AI-enhanced four-legged robot. He finished his Ph.D. at The Australian National University for his contribution on the field of active gaze tracking for human-robot interaction. Rowel's current research work focuses on AI and computer vision. He dreams on building useful machines that can perceive, understand, and reason. To help make his dreams become real, Rowel has been supported by grants from the Department of Science and Technology (DOST), Samsung Research Philippines, and Commission on Higher Education-Philippine California Advanced Research Institutes (CHED-PCARI).
Read more about Rowel Atienza

Right arrow

9. Data generator model in Keras

SSD requires a lot of labeled high-resolution images for object detection. Unlike the previous chapters where the dataset used can be loaded into memory to train the model, SSD implements a multi-threaded data generator. The task of the multi-threaded generator is to load multiple mini-batches of images and their corresponding labels. Because of multi-threading, the GPU can be kept busy as one thread feeds it with data while the rest of CPU threads are in the queue ready to feed another batch data or loading a batch of images from the filesystem and computing the ground truth values. Listing 11.9.1 shows the data generator model in Keras.

The DataGenerator class inherits from the Sequence class of Keras to ensure that it supports multi-processing. DataGenerator guarantees that the entire dataset is used in one epoch.

The length of the entire epoch given a batch size is returned by the __len__() method. Every request for a mini-batch of data...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Advanced Deep Learning with TensorFlow 2 and Keras - Second Edition
Published in: Feb 2020Publisher: PacktISBN-13: 9781838821654

Author (1)

author image
Rowel Atienza

Rowel Atienza is an Associate Professor at the Electrical and Electronics Engineering Institute of the University of the Philippines, Diliman. He holds the Dado and Maria Banatao Institute Professorial Chair in Artificial Intelligence. Rowel has been fascinated with intelligent robots since he graduated from the University of the Philippines. He received his MEng from the National University of Singapore for his work on an AI-enhanced four-legged robot. He finished his Ph.D. at The Australian National University for his contribution on the field of active gaze tracking for human-robot interaction. Rowel's current research work focuses on AI and computer vision. He dreams on building useful machines that can perceive, understand, and reason. To help make his dreams become real, Rowel has been supported by grants from the Department of Science and Technology (DOST), Samsung Research Philippines, and Commission on Higher Education-Philippine California Advanced Research Institutes (CHED-PCARI).
Read more about Rowel Atienza