February 2019
Beginner to intermediate
308 pages
7h 42m
English
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 ...