Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Deep Learning Architectures with Python

You're reading from  Hands-On Deep Learning Architectures with Python

Product type Book
Published in Apr 2019
Publisher Packt
ISBN-13 9781788998086
Pages 316 pages
Edition 1st Edition
Languages
Authors (2):
Yuxi (Hayden) Liu Yuxi (Hayden) Liu
Profile icon Yuxi (Hayden) Liu
Saransh Mehta Saransh Mehta
Profile icon Saransh Mehta
View More author details
Toc

Table of Contents (15) Chapters close

Preface 1. Section 1: The Elements of Deep Learning
2. Getting Started with Deep Learning 3. Deep Feedforward Networks 4. Restricted Boltzmann Machines and Autoencoders 5. Section 2: Convolutional Neural Networks
6. CNN Architecture 7. Mobile Neural Networks and CNNs 8. Section 3: Sequence Modeling
9. Recurrent Neural Networks 10. Section 4: Generative Adversarial Networks (GANs)
11. Generative Adversarial Networks 12. Section 5: The Future of Deep Learning and Advanced Artificial Intelligence
13. New Trends of Deep Learning 14. Other Books You May Enjoy

Implementing MobileNetV2

We will follow a process that's similar to the one we followed for MobileNet. You can find MobileNetV2 in the Keras applications. We will use the same codes as we did for MobileNet, except we will use MobileNetV2 this time. For your reference, the code is as follows:

import keras
from keras.preprocessing import image
from keras.applications import imagenet_utils
from keras.applications.mobilenet import preprocess_input
from keras.models import Model


import numpy as np
import argparse
import matplotlib.pyplot as plt


model = keras.applications.mobilenet_v2.MobileNetV2(weights = 'imagenet')

parser = argparse.ArgumentParser()
parser.add_argument('--im_path', type = str, help = 'path to the image')
args = parser.parse_args()

# adding the path to image
IM_PATH = args.im_path

img = image.load_img(IM_PATH, target_size = (224, 224))
img...
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 ₹800/month. Cancel anytime