The Face API which is part of the Microsoft Cognitive Services helps to identify and detect faces. It can also be used to find similar faces, to verify if two images contain the same person and you can also train the service to improve the identification of people.
In this blog post I will show you how to get started with Python and Jupyter Notebooks using Microsoft Azure Notebooks, http://Notebooks.azure.com
Microsoft Cognitive Face API https://azure.microsoft.com/en-gb/services/cognitive-services/face/ has two main functions: face detection with attributes and face recognition.
Face Detection Face API detects up to 64 human faces with high precision face location in an image. And the image can be specified by file in bytes or valid URL.
Face rectangle (left, top, width and height) indicating the face location in the image is returned along with each detected face. Optionally, face detection extracts a series of face related attributes such as pose, gender, age, head pose, facial hair and glasses. Refer to Face - Detect for more details.
Face recognition is widely used in many scenarios including security, natural user interface, image content analysis and management, mobile apps, and robotics. Four face recognition functions are provided: face verification, finding similar faces, face grouping, and person identification.
Face Verification Face API verification performs an authentication against two detected faces or authentication from one detected face to one person object. Refer to Face - Verify for more details.
The application will use the detect service which detects faces and shows the age, gender, emotions and other data of the detected face.Prerequisites: Create the Face API Service in Azure
As all Microsoft cognitive services, you can also create the face API service in Azure via the portal. It is part of the “Cognitive Services APIs”, so just search for it and create it. Select the Face API as the type of the cognitive service and check the pricing options: As per my previous post on the translation API the FREE services is more than suitable for introducing Cognitive Services. Simply select the F0 FREE plan
After the creation, we just need to note the API key and the API endpoint. Navigate to the service in the Azure portal and you will see the endpoint url in the overview. It’s currently only available in west-us, so the endpoint url will be: https://westus.api.cognitive.microsoft.com/face/v1.0
The keys can be found in “Keys” – just copy one of them and use it later in the application:
Using Azure Juypter Notebook
Python Code for Notebook or Python Application
So this simple example has shown the introduction of using Python to access the Microsoft Cognitive APIs from this students can go on and develop application or feature for face detection, emotion etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.