Book Image

Deep Learning for Computer Vision

By : Rajalingappaa Shanmugamani
Book Image

Deep Learning for Computer Vision

By: Rajalingappaa Shanmugamani

Overview of this book

Deep learning has shown its power in several application areas of Artificial Intelligence, especially in Computer Vision. Computer Vision is the science of understanding and manipulating images, and finds enormous applications in the areas of robotics, automation, and so on. This book will also show you, with practical examples, how to develop Computer Vision applications by leveraging the power of deep learning. In this book, you will learn different techniques related to object classification, object detection, image segmentation, captioning, image generation, face analysis, and more. You will also explore their applications using popular Python libraries such as TensorFlow and Keras. This book will help you master state-of-the-art, deep learning algorithms and their implementation.
Table of Contents (17 chapters)
Title Page
Copyright and Credits
Packt Upsell
Foreword
Contributors
Preface

Training a model for cats versus dogs


In this section, we will prepare and train a model for predicting cats versus dogs and understand some techniques which increase the accuracy. Most of the image classification problems come into this paradigm. Techniques covered in this section, such as augmentation and transfer learning, are useful for several problems.

Preparing the data

For the purpose of classification, we will download the data from kaggle and store in an appropriate format. Sign up and log in to www.kaggle.com and go to https://www.kaggle.com/c/dogs-vs-cats/data. Download the train.zip and test1.zip files from that page. The train.zip file contains 25,000 images of pet data. We will use only a portion of the data to train a model. Readers with more computing power, such as a Graphics Processing Unit (GPU), can use more data than suggested. Run the following script to rearrange the images and create the necessary folders:

import os
import shutil

work_dir = '' # give your correct directory...