Skip to Content
Neural Network Projects with Python
book

Neural Network Projects with Python

by James Loy
February 2019
Beginner to intermediate
308 pages
7h 42m
English
Packt Publishing
Content preview from Neural Network Projects with Python

Face recognition process

With the onboarding process complete, we can now move on to the actual face recognition process. We start by asking the user for their name. The name will be displayed above the detected face, as we shall see later. The input function in Python allows the user to enter their name:

name = input("What is your name?")

The user will then enter a name on the command line when prompted.

Next, let's import our pre-trained Siamese neural network from earlier in the chapter:

from keras.models import load_modelmodel = load_model('siamese_nn.h5',                     custom_objects={'contrastive_loss':                     utils.contrastive_loss,                     'euclidean_distance':utils.euclidean_distance})

Next, we load the true image of the user captured during the onboarding ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Machine Learning with Python Cookbook

Machine Learning with Python Cookbook

Chris Albon

Publisher Resources

ISBN: 9781789138900Supplemental Content