Book Image

Computer Vision Projects with OpenCV and Python 3

By : Matthew Rever
Book Image

Computer Vision Projects with OpenCV and Python 3

By: Matthew Rever

Overview of this book

Python is the ideal programming language for rapidly prototyping and developing production-grade codes for image processing and Computer Vision with its robust syntax and wealth of powerful libraries. This book will help you design and develop production-grade Computer Vision projects tackling real-world problems. With the help of this book, you will learn how to set up Anaconda and Python for the major OSes with cutting-edge third-party libraries for Computer Vision. You'll learn state-of-the-art techniques for classifying images, finding and identifying human postures, and detecting faces within videos. You will use powerful machine learning tools such as OpenCV, Dlib, and TensorFlow to build exciting projects such as classifying handwritten digits, detecting facial features,and much more. The book also covers some advanced projects, such as reading text from license plates from real-world images using Google’s Tesseract software, and tracking human body poses using DeeperCut within TensorFlow. By the end of this book, you will have the expertise required to build your own Computer Vision projects using Python and its associated libraries.
Table of Contents (9 chapters)

Speeding up computation with your GPU

In this section, we'll talk briefly about speeding up computations with your GPU. The good news is that TensorFlow is actually very smart about using the GPU, so if you have everything set up, then it's pretty simple.

Let's see what things look like if we have the GPU properly set up. First, import TensorFlow as follows:

import tensorflow

Next, we print tensorflow.Session(). This just gives us information about our CPU and GPU (if it is properly set up):

print(tensorflow.Session())

The output is as follows:

As we can see from the output, we're using a laptop with a GeForce GTX 970M, which is CUDA-compatible. This is needed in order to run TensorFlow with the GPU. If everything is set up properly, you will see a message very similar to the preceding output for your GPU, your card model, and details about it such as its...