Preface
This article series is a complete end to end tutorial that will explain the concept of face recognition and face detection using modern AI-based Azure cognitive service; i.e. Azure’s Face API service.
Introduction
With the world changing at a rapid pace in the technology space, we see ourselves surrounded by machine learning and artificial intelligence. AI-based technologies are booming and programming languages have become a medium to facilitate the techniques.
The Face API enables developers to easily perform face identification, detection and sentiment analysis with simple HTTP calls. This functionality could be directly integrated into any app and could be used to solve n number of business problems. In this article, we’ll cover the Azure Face API topic in detail. We’ll set up an Azure account, a Face API account and get the Face API running within seconds. We’ll see what all are the API’s that could be used to get accustomed with Face API. We’ll also integrate those HTTP services to an application that performs face detection, face grouping, face identification and finding similar faces as well from the group of faces.
You’ll see how easily you can detect a face in the picture, get its properties like - does a person whose face is detected wear glasses in the picture? Is the person a male or a female? What's the age of the person? And other attributes like facial hair, eyes, nose, lips, etc. Not only this, but we also get the on-demand details to find the facial expressions like is the person, happy, sad or angry and what is the scale of the emotion detected. Get more details here. So, it's a lot of fun altogether.
Tutorial Series
The entire series on learning Face API Cognitive Services is divided into four parts. The first part focuses on Azure Functions, Serverless Computing, and creating and testing Face API on Azure Portal.
The second part explains the use of Face API SDK. The third part will be focused on face identification, where the person groups will be created, and the identification of faces would be done via training the models i.e. via machine learning techniques. The fourth part is the most interesting part that gives a walkthrough of Face classification application which performs face detection, identification, grouping and finding look-alike faces. Following is the four-part series.
- Face API Cognitive Service Day 1: Face API on Azure Portal.
- Face API Cognitive Service Day 2: Exploring Face API SDK.
- Face API Cognitive Service Day 3: Face Identification using Face API.
- Face API Cognitive Service Day 4: Face classification using Face API.
Azure
Azure is a cloud platform from Microsoft and provides numerous resources in context on cloud computing. One of the resources is virtual machine; i.e. a fully functional machine of your choice with the choice of your configurations and operating system could be created within seconds with just a few clicks and you can access the machine remotely from anywhere with your secure credentials and do whatever you want; e.g. hosting your web site, developing applications, creating production or test environment for your software, etc. Let’s see step by step how we can achieve that.
Azure Functions and Serverless Computing
Talking about the definitions from here,
“Azure Functions is the serverless computing service hosted on the Microsoft Azure public cloud. Azure Functions, and serverless computing, in general, is designed to accelerate and simplify application development.”
The first thing to note about Azure Functions is that they operate in a fully-managed environment. Essentially what this means is that we don't have to go and create or manage virtual machines. Microsoft provides and provisions all the underlying hardware that our Azure Functions are based on. One of the benefits of this is that it gives us high reliability because we don't have to manually manage the underlying infrastructure. Another benefit is that we don't have to worry about going and applying security patches to the underlying infrastructure. Microsoft will take care of this for us.
It is, however, up to us to ensure that the systems that we're building on top of Azure Functions are appropriately secured and managed. Another benefit of this fully- managed environment is that it gives us automatic scaling. The Azure Functions platform will automatically scale our functions out to deal with variations in incoming request volume. If we're executing our Azure Functions on the Consumption plan, then we're only going to pay when the functions are executed. Another benefit of Azure Functions is that we need to write less boilerplate code, and one of the reasons for this is that our Azure Functions can easily integrate with a range of Azure services. For example, integrating our function with Azure Blob storage is as simple as configuring the correct attributes on our C# code.
Azure Account Setup
If one does not have a paid Azure account, one could leverage Azure’s new account’s benefits of giving $200 credits. That means if you are new to Azure and want to play around with its free trial, you’ll get $200 credits that you can use to explore Azure. If you are new to Azure and do not have an account, follow the following process, else directly login to your portal.
- Open the Azure web site i.e. azure.microsoft.com

- Click on Start free to create your free Azure account and get $200 as credits.

Creating an account and claiming $200 would need your credit/debit card for verification purposes only and will not deduct any amount from your card. You can play around with this credit and account for 30 days. You’ll see the signup page, where you fill all your information and signup step by step. Once signed-up successfully, you’ll see the link to the portal as shown below.
Click on the portal and you land up on the dashboard and are ready to use/play around with Azure.
Face API
Azure AI Services consist of many different services. The one that probably gets the most attention is Cognitive Services, which is Microsoft's prebuilt AI. The Face API is an example of a cognitive service, so it lives squarely in this category.
The Face API has five major feature areas. The most fundamental operation is face detection. The detection will provide the exact location of where faces appear in images, it will also provide metadata about the faces that it detects, such as age estimates, gender, and numerous face attributes such as facial hair, and whether the person has glasses.
Emotion metadata is detected here as well. Identification is what we think of as facial recognition. It can identify a specific known individual, provided that the Face API has been pre-trained to identify that individual.
Verification is a type of facial recognition, but with Verification, we're just trying to match a face against a specific person, not a group of people. The best example of this is when you try to unlock your computer or phone using your face.
Face Grouping attempts to group faces of the same individual provided a list of faces.
Finally, Find Similar functionality will find similar faces given a list of faces. This will either try to find the exact person or, depending on which mode you've selected, a face that looks similar. This second mode would be used, for example, if you're trying to find your celebrity look-alike. We're going to see each one of these features in action in this article.
Creating the Face API on Azure Portal
In this section, we'll get up and running with the Face API on Azure Portal. We’ll go step by step so that we do not miss any single detail.
- Log in to the Azure portal and click on “Create a resource”. You can find this option on the left side panel.

- On the screen select “AI + Machine Learning” and you’ll see all the ML offerings provided by Azure. There we see an offering with the name as “Face”. Select that option.
















Sreekanth ReddyPosted Feb 26, 2020, 7:25 AM
Postman screenshot not able to see.