In part 1 of this series I showed you how to create a Face API subscription from Microsoft Cognitive Services and then use the Face API library to detect faces from an image. In this post we’ll expand on the previous to include Face Verification. Let’s get started.

Picking up where we left off, we will want to detect the most prominent face from an image and then use the detected face and verify it to see if they belong to the same person.

1. I refactored the code in the BrowsePhoto method to return an image that was selected. This method is then used by both the Identification and Verification images processes.

2. I refactored the UI to show 2 different images files, so means there is now 2 click events to identify the person in the image and then use this identification to verify its the same person when we load up another image. Both of these events can be seen here:

image

3. Finally we will be using the Face API VerifyAsync method to check to faces and determine if they belong to the same person.

image

4. Now let’s run the application across a few images and see how well it performs with two images of me from different years. In the first result I have an image from 10+ years ago and the Face API has come back that its 66% certain it’s the same person.

image

How about using something more recent. In this next test run the Face API again detects its 75% certain its the same person.

image

Wrap up

As you can see I’m able to use the Face API from Microsoft Cognitive Services to not only detect by also verify identity. The Face API provides other methods that can be used for grouping, people together and training it to recognize specific people with their identification method.The Face API has also recently been updated to support a large group of people (1,000 in the free tier and over 1,000,000 in the paid tier).

Enjoy!

References

Sample Code

Face API Documentation

Posted by Callon Campbell [MVP]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s