What is the Azure Face API?
The Azure Face API is a cognitive service that provides algorithms for detecting, recognizing, and analyzing human faces in images. The ability to process human face information is important in many different software scenarios, such as security, natural user interface, image content analysis and management, mobile apps, and robotics.
The Face API provides several different functions, each outlined in the following sections. Read on to learn more about each.
The Face API can detect human faces in an image and return the rectangle coordinates of their locations. Optionally, face detection can extract a series of face-related attributes such as pose, head pose, gender, age, emotion, facial hair, and glasses.
The face detection feature is also available through the Computer Vision API, but if you wish to do further operations with face data, you should use the Face API (this service).
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 is potentially useful in security scenarios. For more information, see the Verify API.
Find similar faces
The Find Similar API takes a target face and a set of candidate faces and finds a smaller set of faces that look most similar to the target face. Two working modes, matchPerson and matchFace are supported. matchPerson mode returns similar faces after filtering for the same person (using the Verify API). matchFace mode ignores the same-person filter and returns a list of similar candidate faces that may or may not belong to the same person.
In the following example, this is the target face:
And these are the candidate faces:
To find four similar faces, matchPerson mode would return (a) and (b), which depict the same person as the target face. matchFace mode returns (a), (b), (c) and (d)—exactly four candidates, even if some are not the same person as the target or have low similarity. For more information, see the Find Similar API.
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, but there can be several different groups for a single person (differentiated by another factor, such as expression for example). For more information, see the Group API.
The Identify API can be used to identify a detected face against a database of people. This may be useful for automatic image tagging in photo management software. You create the database in advance, and it can be edited over time.
The following image depicts an example of a database named "myfriends." Each group may contain up to 1,000,000 different person objects, and each person object can have up to 248 faces registered.
After a database has been 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.
For more information about person identification, see the Identify API.
Use the Face container to detect, recognize, and identify faces, by installing a standardized Docker container closer to your data.
The following sample applications showcase a few of the ways the Face API can be used.
- Microsoft Face API: Windows Client Library & Sample - a WPF app that demonstrates several scenarios of Face detection, analysis and identification.
- FamilyNotes UWP app - 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, developers using the Face service should be aware of Microsoft's policies on customer data. See the Cognitive Services page on the Microsoft Trust Center to learn more.
Follow a quickstart to implement a simple face detection scenario in code.
- Quickstart: Detect faces in an image using the .NET SDK with C# (other languages available)
We'd love to hear your thoughts. Choose the type you'd like to provide:
Our feedback system is built on GitHub Issues. Read more on our blog.