Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Practical Computer Vision

You're reading from   Practical Computer Vision Extract insightful information from images using TensorFlow, Keras, and OpenCV

Arrow left icon
Product type Paperback
Published in Feb 2018
Publisher Packt
ISBN-13 9781788297684
Length 234 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Abhinav Dadhich Abhinav Dadhich
Author Profile Icon Abhinav Dadhich
Abhinav Dadhich
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. A Fast Introduction to Computer Vision FREE CHAPTER 2. Libraries, Development Platform, and Datasets 3. Image Filtering and Transformations in OpenCV 4. What is a Feature? 5. Convolutional Neural Networks 6. Feature-Based Object Detection 7. Segmentation and Tracking 8. 3D Computer Vision 9. Mathematics for Computer Vision 10. Machine Learning for Computer Vision 11. Other Books You May Enjoy

CNN in practice

We will now start with our implementation of a convolutional neural net in Keras. For our example case, we will train a network to classify Fashion-MNIST. This is a dataset of grayscale images of fashion products, of the size 28 x 28. The total number of images is 70,000, with 60,000 as training and 10,000 as a test. There are ten categories in this dataset, which are t-shirt, trousers, pullover, dress, coat, sandal, shirt, sneakers, bag, and ankle boots. Labels for each are marked with a category number from 0-9.

We can load this dataset as follows:

from keras.datasets import fashion_mnist
(x_train, y_train), (x_test, y_test) = fashion_mnist.load_data()

The previous code block doesn't output a visualization of the dataset, so following image is to show what dataset we will be using:

It will split the data into the train and test sets with both inputs...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime