What is the Azure Face API?
The Azure Cognitive Services Face API provides algorithms that are used to detect, recognize, and analyze human faces in images. The ability to process human face information is important in many different software scenarios. Example scenarios are security, natural user interface, image content analysis and management, mobile apps, and robotics.
The Face API provides several different functions. Each function is outlined in the following sections. Read on to learn more about them.
The Face API detects human faces in an image and returns the rectangle coordinates of their locations. Optionally, face detection can extract a series of face-related attributes. Examples are head pose, gender, age, emotion, facial hair, and glasses.
The face detection feature is also available through the Computer Vision API. If you want to do further operations with face data, use the Face API, which is the service discussed in this article.
The Verify API performs an authentication against two detected faces or from one detected face to one person object. Practically, it evaluates whether two faces belong to the same person. This capability is potentially useful in security scenarios. For more information, see the Face recognition concepts guide or the Verify API reference documentation.
Find similar faces
The Find Similar API compares a target face with a set of candidate faces to find a smaller set of faces that look similar to the target face. Two working modes, matchPerson and matchFace, are supported. The matchPerson mode returns similar faces after it filters for the same person by using the Verify API. The matchFace mode ignores the same-person filter. It returns a list of similar candidate faces that might or might not belong to the same person.
The following example shows the target face:
And these are the candidate faces:
To find four similar faces, the matchPerson mode returns a and b, which show the same person as the target face. The matchFace mode returns a, b, c, and d, exactly four candidates, even if some aren't the same person as the target or have low similarity. For more information, see the Face recognition concepts guide or the Find Similar API reference documentation.
The Group API divides a set of unknown faces into several groups based on similarity. Each group is a disjoint proper subset of the original set of faces. All of the faces in a group are likely to belong to the same person. There can be several different groups for a single person. The groups are differentiated by another factor, such as expression, for example. For more information, see the Face recognition concepts guide or the Group API reference documentation.
The Identify API is used to identify a detected face against a database of people. This feature might be useful for automatic image tagging in photo management software. You create the database in advance, and you can edit it over time.
The following image shows an example of a database named "myfriends." Each group can contain up to 1 million different person objects. Each person object can have up to 248 faces registered.
After a database is created and trained, you can perform identification against the group with a new detected face. If the face is identified as a person in the group, the person object is returned.
Use the Face container to detect, recognize, and identify faces by installing a standardized Docker container closer to your data.
The following sample applications show a few ways to use the Face API:
- Microsoft Face API: Windows Client Library and sample is a WPF app that demonstrates several scenarios of Face detection, analysis, and identification.
- FamilyNotes UWP app is a Universal Windows Platform (UWP) app that uses face identification along with speech, Cortana, ink, and camera in a family note-sharing scenario.
Data privacy and security
As with all of the Cognitive Services resources, developers who use the Face service must be aware of Microsoft's policies on customer data. For more information, see the Cognitive Services page on the Microsoft Trust Center.
Follow a quickstart to implement a face-detection scenario in code:
- Quickstart: Detect faces in an image by using the .NET SDK with C#. Other languages are available.
Send feedback about: