TensorFlow 2.0 Computer Vision Cookbook

Book description

Get well versed with state-of-the-art techniques to tailor training processes and boost the performance of computer vision models using machine learning and deep learning techniques

Key Features

  • Develop, train, and use deep learning algorithms for computer vision tasks using TensorFlow 2.x
  • Discover practical recipes to overcome various challenges faced while building computer vision models
  • Enable machines to gain a human level understanding to recognize and analyze digital images and videos

Book Description

Computer vision is a scientific field that enables machines to identify and process digital images and videos. This book focuses on independent recipes to help you perform various computer vision tasks using TensorFlow.

The book begins by taking you through the basics of deep learning for computer vision, along with covering TensorFlow 2.x's key features, such as the Keras and tf.data.Dataset APIs. You'll then learn about the ins and outs of common computer vision tasks, such as image classification, transfer learning, image enhancing and styling, and object detection. The book also covers autoencoders in domains such as inverse image search indexes and image denoising, while offering insights into various architectures used in the recipes, such as convolutional neural networks (CNNs), region-based CNNs (R-CNNs), VGGNet, and You Only Look Once (YOLO).

Moving on, you'll discover tips and tricks to solve any problems faced while building various computer vision applications. Finally, you'll delve into more advanced topics such as Generative Adversarial Networks (GANs), video processing, and AutoML, concluding with a section focused on techniques to help you boost the performance of your networks.

By the end of this TensorFlow book, you'll be able to confidently tackle a wide range of computer vision problems using TensorFlow 2.x.

What you will learn

  • Understand how to detect objects using state-of-the-art models such as YOLOv3
  • Use AutoML to predict gender and age from images
  • Segment images using different approaches such as FCNs and generative models
  • Learn how to improve your network's performance using rank-N accuracy, label smoothing, and test time augmentation
  • Enable machines to recognize people's emotions in videos and real-time streams
  • Access and reuse advanced TensorFlow Hub models to perform image classification and object detection
  • Generate captions for images using CNNs and RNNs

Who this book is for

This book is for computer vision developers and engineers, as well as deep learning practitioners looking for go-to solutions to various problems that commonly arise in computer vision. You will discover how to employ modern machine learning (ML) techniques and deep learning architectures to perform a plethora of computer vision tasks. Basic knowledge of Python programming and computer vision is required.

Table of contents

  1. TensorFlow 2.0 Computer Vision Cookbook
  2. Why subscribe?
  3. Contributors
  4. About the author
  5. About the reviewers
  6. Packt is searching for authors like you
  7. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
    4. Code in Action
    5. Download the color images
    6. Conventions used
    7. Sections
      1. How to do it…
      2. How it works…
      3. There’s more…
      4. See also
    8. Get in touch
    9. Reviews
  8. Chapter 1: Getting Started with TensorFlow 2.x for Computer Vision
    1. Technical requirements
    2. Working with the basic building blocks of the Keras API
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    3. Loading images using the Keras API
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    4. Loading images using the tf.data.Dataset API
      1. How to do it…
      2. How it works…
      3. See also
    5. Saving and loading a model
      1. How to do it…
      2. How it works…
      3. There's more…
    6. Visualizing a model's architecture
      1. Getting ready
      2. How to do it…
      3. How it works…
    7. Creating a basic image classifier
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
  9. Chapter 2: Performing Image Classification
    1. Technical requirements
    2. Creating a binary classifier to detect smiles
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    3. Creating a multi-class classifier to play rock paper scissors
      1. Getting ready
      2. How to do it…
      3. How it works…
    4. Creating a multi-label classifier to label watches
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    5. Implementing ResNet from scratch
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    6. Classifying images with a pre-trained network using the Keras API
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    7. Classifying images with a pre-trained network using TensorFlow Hub
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    8. Using data augmentation to improve performance with the Keras API
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    9. Using data augmentation to improve performance with the tf.data and tf.image APIs
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
  10. Chapter 3: Harnessing the Power of Pre-Trained Networks with Transfer Learning
    1. Technical requirements
    2. Implementing a feature extractor using a pre-trained network
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    3. Training a simple classifier on extracted features
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    4. Spot-checking extractors and classifiers
      1. Getting ready
      2. How to do it…
      3. How it works…
    5. Using incremental learning to train a classifier
      1. Getting ready
      2. How to do it…
      3. How it works…
    6. Fine-tuning a network using the Keras API
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    7. Fine-tuning a network using TFHub
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
  11. Chapter 4: Enhancing and Styling Images with DeepDream, Neural Style Transfer, and Image Super-Resolution
    1. Technical requirements
    2. Implementing DeepDream
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    3. Generating your own dreamy images
      1. Getting ready
      2. How to do it…
      3. How it works…
    4. Implementing Neural Style Transfer
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    5. Applying style transfer to custom images
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    6. Applying style transfer with TFHub
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    7. Improving image resolution with deep learning
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
  12. Chapter 5: Reducing Noise with Autoencoders
    1. Technical requirements
    2. Creating a simple fully connected autoencoder
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    3. Creating a convolutional autoencoder
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    4. Denoising images with autoencoders
      1. Getting ready
      2. How to do it…
      3. How it works…
    5. Spotting outliers using autoencoders
      1. Getting ready
      2. How to do it…
      3. How it works…
    6. Creating an inverse image search index with deep learning
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    7. Implementing a variational autoencoder
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
  13. Chapter 6: Generative Models and Adversarial Attacks
    1. Technical requirements
    2. Implementing a deep convolutional GAN
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    3. Using a DCGAN for semi-supervised learning
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    4. Translating images with Pix2Pix
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    5. Translating unpaired images with CycleGAN
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    6. Implementing an adversarial attack using the Fast Gradient Signed Method
      1. Getting ready
      2. How to do it
      3. How it works…
      4. See also
  14. Chapter 7: Captioning Images with CNNs and RNNs
    1. Technical requirements
    2. Implementing a reusable image caption feature extractor
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    3. Implementing an image captioning network
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    4. Generating captions for your own photos
      1. Getting ready
      2. How to do it…
      3. How it works…
    5. Implementing an image captioning network on COCO with attention
      1. Getting ready
      2. How to do it…
  15. Chapter 8: Fine-Grained Understanding of Images through Segmentation
    1. Technical requirements
    2. Creating a fully convolutional network for image segmentation
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    3. Implementing a U-Net from scratch
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    4. Implementing a U-Net with transfer learning
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    5. Segmenting images using Mask-RCNN and TensorFlow Hub
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
  16. Chapter 9: Localizing Elements in Images with Object Detection
    1. Technical requirements
    2. Creating an object detector with image pyramids and sliding windows
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    3. Detecting objects with YOLOv3
      1. Getting ready
      2. How it works…
      3. See also
    4. Training your own object detector with TensorFlow's Object Detection API
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    5. Detecting objects using TFHub
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
  17. Chapter 10: Applying the Power of Deep Learning to Videos
    1. Technical requirements
    2. Detecting emotions in real time
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    3. Recognizing actions with TensorFlow Hub
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    4. Generating the middle frames of a video with TensorFlow Hub
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    5. Performing text-to-video retrieval with TensorFlow Hub
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
  18. Chapter 11: Streamlining Network Implementation with AutoML
    1. Technical requirements
    2. Creating a simple image classifier with AutoKeras
      1. How to do it…
      2. How it works…
      3. See also
    3. Creating a simple image regressor with AutoKeras
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    4. Exporting and importing a model in AutoKeras
      1. How to do it…
      2. How it works…
      3. See also
    5. Controlling architecture generation with AutoKeras' AutoModel
      1. How to do it…
      2. How it works…
      3. See also
    6. Predicting age and gender with AutoKeras
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
  19. Chapter 12: Boosting Performance
    1. Technical requirements
    2. Using convolutional neural network ensembles to improve accuracy
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    3. Using test time augmentation to improve accuracy
      1. Getting ready
      2. How to do it…
      3. How it works…
    4. Using rank-N accuracy to evaluate performance
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    5. Using label smoothing to increase performance
      1. Getting ready
      2. How to do it…
      3. How it works…
    6. Checkpointing model
      1. How to do it…
    7. Customizing the training process using tf.GradientTape
      1. How to do it…
      2. How it works…
      3. Getting ready
      4. How to do it…
      5. How it works…
      6. See also
  20. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: TensorFlow 2.0 Computer Vision Cookbook
  • Author(s): Jesus Martinez
  • Release date: February 2021
  • Publisher(s): Packt Publishing
  • ISBN: 9781838829131