Skip to content

Commit 770837f

Browse files
Merge pull request #4899 from laujan/paul-4894-face
Paul 4894 face
2 parents ed2d718 + df934bf commit 770837f

File tree

5 files changed

+353
-0
lines changed

5 files changed

+353
-0
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
title: Azure AI Content Understanding face overview
3+
titleSuffix: Azure AI services
4+
description: Learn about Azure AI Content Understanding face solutions.
5+
author: laujan
6+
ms.author: quentinm
7+
manager: nitinme
8+
ms.service: azure-ai-content-understanding
9+
ms.topic: overview
10+
ms.date: 05/19/2025
11+
ms.custom: build-2025-understanding-refresh
12+
---
13+
14+
# Azure AI Content Understanding face solutions (preview)
15+
16+
> [!IMPORTANT]
17+
>
18+
> * Azure AI Content Understanding is available in preview. Public preview releases provide early access to features that are in active development.
19+
> * Features, approaches, and processes can change or have limited capabilities, before General Availability (GA).
20+
> * For more information, *see* [**Supplemental Terms of Use for Microsoft Azure Previews**](https://azure.microsoft.com/support/legal/preview-supplemental-terms).
21+
22+
Azure AI Content Understanding provides a cloud-based solution for face detection, enrollment, and recognition, enabling secure and intelligent applications. Developers can apply these capabilities to detect faces, organize them into a structured directory, and perform recognition tasks for identity verification and content management.
23+
24+
This service is ideal for building secure access systems, streamlining photo management, or implementing intelligent attendance and check-in solutions. It supports both standalone face records and structured person identity management, offering flexibility for various real-world scenarios.
25+
26+
## Business use cases
27+
28+
Content Understanding enables a wide range of real-world applications, including face detection, verification, identification, and large-scale content processing.
29+
30+
##### Detect faces in images
31+
32+
Automatically identify faces in an image and return their bounding boxes. This capability simplifies tasks like highlighting, blurring, or counting faces without manual review. Common use cases include:
33+
34+
* Cropping detected faces for ID photos, albums, or personalized content.
35+
* Blurring faces to ensure privacy before sharing images publicly.
36+
* Counting people in event photos, crowd scenes, or security footage.
37+
38+
##### Verify if two faces match
39+
40+
Compare a face in one image with another face or an enrolled person and determine if they belong to the same individual. This comparison feature is ideal for identity verification scenarios such as photo ID checks or sign-ins. Common use cases include:
41+
42+
* Verifying if a driver's selfie matches their profile photo.
43+
* Confirming a student's identity before starting an online exam.
44+
* Comparing a live photo with an uploaded ID for identity confirmation.
45+
46+
##### Identify a person from their face
47+
48+
Match a face in a photo to a saved list of people and identify them. Common use cases include:
49+
50+
* Matching a patient's face to hospital records during check-in.
51+
* Identifying a student or employee from their face photo.
52+
* Recognizing someone from a watch list entering a secure area.
53+
54+
##### Save faces for faster future searches
55+
56+
Index faces from images to enable quicker searches later without needing to reprocess the original content. This feature is especially useful for recurring search scenarios. Common use cases include:
57+
58+
* Extracting and saving faces from group photos at events to recognize returning participants in future sessions.
59+
* Processing images from school activities or sports events to easily identify students or athletes in subsequent searches.
60+
* Matching a theme park visitor's face to records from previous visits without rescanning years of archived photos.
61+
62+
## Face capabilities
63+
64+
Content Understanding offers robust face capabilities, including detection, quality analysis, identity enrollment, and search. Central to these features is the **person directory**—a scalable, structured repository for managing persons and faces.
65+
66+
### Person Directory
67+
68+
The person directory is a flexible system for organizing face data and identity profiles. Key features include:
69+
* **Face enrollment**: Add detected faces as standalone entries or associate them with specific persons.
70+
* **Person enrollment**: Create identity records that link to one or more enrolled faces.
71+
* **Metadata management**: Update metadata, apply tags, and manage relationships between persons and faces.
72+
* **Dynamic associations**: Associate or disassociate faces from persons without losing data, ensuring clean and maintainable identity management.
73+
74+
:::image type="content" source="../media/face/person-directory-overview.png" alt-text="Diagram illustrating the flow of the person directory.":::
75+
76+
### Search capabilities
77+
78+
The person directory enables powerful search and matching functionalities:
79+
* **Identify candidate persons**: Match an input face to candidate persons in the directory.
80+
* **Find similar faces**: Search for all similar faces across the entire directory.
81+
82+
## Key benefits
83+
84+
Content Understanding provides advanced face recognition capabilities tailored for secure, scalable, and intelligent applications:
85+
* **Comprehensive face intelligence**: Detect, enroll, and recognize faces seamlessly using a unified cloud-based service. It supports both standalone face records and structured person identity management.
86+
* **Adaptable and scalable for diverse scenarios**: Enables secure access, streamlined check-ins, customer recognition, and efficient photo management with rapid, accurate face searches across extensive collections.
87+
88+
## Data privacy and security
89+
90+
Azure AI Content Understanding adheres to Microsoft's strict policies on customer data protection and privacy. Developers should review these policies to ensure compliance and understand how data is handled. For more details, visit the [Data protection and privacy](https://www.microsoft.com/trust-center/privacy) page.
91+
92+
## Next steps
93+
94+
* Learn to build a [**person directory**](../tutorial/build-person-directory.md).
95+
* Review code sample: [**person directory**](https://github.com/Azure-Samples/azure-ai-content-understanding-python/blob/zhizho/face/notebooks/build_person_directory.ipynb).
167 KB
Loading
307 KB
Loading

articles/ai-services/content-understanding/toc.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ items:
5454
- name: Video
5555
href: video/overview.md
5656
displayName: video, audio, voice, recognition, synthesis, speaker, identification, verification, diarization, transcription, translation, language, understanding, sentiment, analysis, emotion, detection, pronunciation, model
57+
- name: Face
58+
displayName: face, recognition, detection, analysis, identification, verification
59+
href: face/overview.md
5760
- name: Best practices
5861
displayName: best practices, analyzers, optimization, fields
5962
href: concepts/best-practices.md
@@ -82,6 +85,9 @@ items:
8285
- name: Build a retrieval-augmented solution
8386
displayName: RAG, retrieval, augmented, generation, knowledge, base, search, index, vector
8487
href: tutorial/build-rag-solution.md
88+
- name: Build a person directory
89+
displayName: person, directory, search, index, vector
90+
href: tutorial/build-person-directory.md
8591
- name: Responsible AI
8692
items:
8793
- name: Transparency note
Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
---
2+
title: Build a person directory with Azure AI Content Understanding Face APIs
3+
titleSuffix: Azure AI services
4+
description: Learn to build a person directory with Content Understanding Face APIs
5+
author: laujan
6+
ms.author: quentinm
7+
manager: nitinme
8+
ms.service: azure-ai-content-understanding
9+
ms.topic: tutorial
10+
ms.date: 05/19/2025
11+
---
12+
13+
# Tutorial: Build a person directory
14+
15+
A person directory provides a structured approach to storing face data for recognition tasks. It allows you to add individual faces, search for visually similar faces, and create person profiles. You can associate faces with these profiles and match new face images to known individuals. This setup supports both flexible face matching and identity recognition across images and videos.
16+
17+
:::image type="content" source="../media/face/person-directory-processes.png" alt-text="Diagram illustrating the processes of enrollment and search in a person directory.":::
18+
19+
## Data storage recommendation
20+
21+
For secure and scalable access, we recommend storing all face images in Azure Blob Storage. When making API calls, ensure that the face URLs reference these stored images in Blob Storage.
22+
23+
## Enrollment
24+
25+
Enrollment involves the following steps:
26+
27+
1. [Create an empty person directory](#create-an-empty-person-directory)
28+
1. [Add persons](#add-persons)
29+
1. [Add faces and associate with a person](#add-faces-and-associate-with-a-person)
30+
31+
### Create an empty person directory
32+
33+
To create a new person directory, send a `PUT` request to the API endpoint. This directory serves as the container for storing faces and associated persons.
34+
35+
```http
36+
PUT {endpoint}/contentunderstanding/personDirectories/{personDirectoryId}?api-version=2025-05-01-preview
37+
Content-Type: application/json
38+
39+
{
40+
"description": "A brief description of the directory",
41+
"tags": {
42+
"project": "example-project",
43+
"owner": "team-name"
44+
}
45+
}
46+
```
47+
48+
* `personDirectoryId`: A unique, user-defined identifier for the directory within the resource.
49+
* `description`: (Optional) A short description of the directory's purpose.
50+
* `tags`: (Optional) Key-value pairs to help organize and manage the directory.
51+
52+
The API creates the directory and returns a confirmation response.
53+
54+
```json
55+
200 OK
56+
57+
{
58+
"personDirectoryId": "{personDirectoryId}",
59+
"description": "A brief description of the directory",
60+
"createdAt": "2025-05-01T18:46:36.051Z",
61+
"lastModifiedAt": "2025-05-01T18:46:36.051Z",
62+
"tags": {
63+
"project": "example-project",
64+
"owner": "team-name"
65+
},
66+
"personCount": 0,
67+
"faceCount": 0
68+
}
69+
```
70+
71+
### Add persons
72+
73+
To recognize or manage individuals, you need to create a person profile. Once created, you can associate faces with this person.
74+
75+
```http
76+
POST {endpoint}/contentunderstanding/personDirectories/{personDirectoryId}/persons?api-version=2025-05-01-preview
77+
Content-Type: application/json
78+
79+
{
80+
"tags": {
81+
"name": "Alice",
82+
"age": "20"
83+
}
84+
}
85+
```
86+
87+
* `personDirectoryId`: The unique identifier of the directory created in Step 1.
88+
* `tags`: Key-value pairs to describe the person, such as their name or age.
89+
90+
The API returns a `personId` that uniquely identifies the created person.
91+
92+
```json
93+
200 OK
94+
95+
{
96+
"personId": "4f66b612-e57d-4d17-9ef7-b951aea2cf0f",
97+
"tags": {
98+
"name": "Alice",
99+
"age": "20"
100+
}
101+
}
102+
```
103+
104+
### Add faces and associate with a person
105+
106+
You can add a face to the directory and optionally associate it with an existing person. The API supports both image URLs and base64-encoded image data.
107+
108+
```http
109+
POST {endpoint}/contentunderstanding/personDirectories/{personDirectoryId}/faces?api-version=2025-05-01-preview
110+
Content-Type: application/json
111+
112+
{
113+
"faceSource": {
114+
"url": "https://mystorageaccount.blob.core.windows.net/container/face.jpg",
115+
// "data": "<base64 data>",
116+
"imageReferenceId": "face.jpg",
117+
"targetBoundingBox": {
118+
"left": 33,
119+
"top": 73,
120+
"width": 262,
121+
"height": 324
122+
}
123+
},
124+
"qualityThreshold": "medium",
125+
"personId": "{personId}"
126+
}
127+
```
128+
129+
- `personDirectoryId`: The unique identifier of the person directory created in Step 1.
130+
- `faceSource`: Specifies the face image.
131+
- `url`: The file path of the image stored in Azure Blob Storage.
132+
- `data`: Base64-encoded image data as optional alternative to `url`.
133+
- `imageReferenceId`: (Optional) A user-defined identifier for the image. This identifier can be helpful for tracking the image's origin or for mapping it to other data.
134+
- `targetBoundingBox`: (Optional) Approximate location of the face in the image. If omitted, the API detects and uses the largest face.
135+
- `qualityThreshold`: (Optional) Filters face quality (`low`, `medium`, or `high`). The default is `medium`, meaning only medium or high-quality faces are stored. Lower quality faces are rejected.
136+
- `personId`: (Optional) The `personId` of an existing person to associate the face with.
137+
138+
The API returns a `faceId` that uniquely identifies the created face with the detected `boundingBox` of the face.
139+
140+
```json
141+
{
142+
"faceId": "{faceId}",
143+
"personId": "{personId}",
144+
"imageReferenceId": "face.jpg",
145+
"boundingBox": {
146+
"left": 30,
147+
"top": 78,
148+
"width": 251,
149+
"height": 309
150+
}
151+
}
152+
```
153+
154+
## Search
155+
156+
After creating your person directory and adding face images with optional person associations, you can perform two key tasks:
157+
158+
1. **[Identify a person](#identify-a-person)**: Match a face image against enrolled persons in the directory and determine the most likely identity.
159+
1. **[Find similar faces](#find-similar-faces)**: Search for visually similar faces across all stored face entries in the directory.
160+
161+
These capabilities enable robust face recognition and similarity matching for various applications.
162+
163+
### Identify a person
164+
165+
Identify the most likely person matches by comparing the input face against enrolled persons in the directory.
166+
167+
```http
168+
POST {endpoint}/contentunderstanding/personDirectory/{personDirectoryId}/persons:identify?api-version=2025-05-01-preview
169+
Content-Type: application/json
170+
171+
{
172+
"faceSource": {
173+
"url": "https://mystorageaccount.blob.core.windows.net/container/unknown.jpg",
174+
"targetBoundingBox": { ... }
175+
},
176+
"maxPersonCandidates": 1
177+
}
178+
```
179+
180+
- `faceSource.url`: The URL of the input face image stored in Azure Blob Storage.
181+
- `faceSource.targetBoundingBox`: (Optional) The approximate bounding box of the face in the image. If omitted, the API detects the largest face.
182+
- `maxPersonCandidates`: (Optional) The maximum number of person candidates to return. Default is 1.
183+
184+
The API returns the detected bounding box of the face along with the top person candidates.
185+
186+
```json
187+
{
188+
"detectedFace": {
189+
"boundingBox": { ... }
190+
},
191+
"personCandidates": [
192+
{
193+
"personId": "{personId1}",
194+
"tags": {
195+
"name": "Alice",
196+
"age": "20"
197+
},
198+
"confidence": 0.92
199+
}
200+
]
201+
}
202+
```
203+
204+
- `detectedFace.boundingBox`: The bounding box of the detected face in the input image.
205+
- `personCandidates`: A list of potential matches, each with a `personId`, associated `tags`, and a `confidence` score indicating the likelihood of a match.
206+
207+
### Find similar faces
208+
209+
Find visually similar faces from all stored face entries in the directory.
210+
211+
```http
212+
POST {endpoint}/personDirectory/{personDirectoryId}/faces:find?api-version=2025-05-01-preview
213+
Content-Type: application/json
214+
215+
{
216+
"faceSource": {
217+
"url": "https://mystorageaccount.blob.core.windows.net/container/target.jpg",
218+
"targetBoundingBox": { ... }
219+
},
220+
"maxSimilarFaces": 10
221+
}
222+
```
223+
224+
- `faceSource.url`: The URL of the input face image stored in Azure Blob Storage.
225+
- `faceSource.targetBoundingBox`: (Optional) The approximate bounding box of the face in the image. If omitted, the API detects the largest face.
226+
- `maxSimilarFaces`: (Optional) The maximum number of similar faces to return. Defaults to 1000, with a maximum limit of 1000.
227+
228+
The API returns the detected bounding box of the face along with the most similar faces from the directory.
229+
230+
```json
231+
{
232+
"detectedFace": {
233+
"boundingBox": { ... }
234+
},
235+
"similarFaces": [
236+
{
237+
"faceId": "{faceId}",
238+
"boundingBox": { ... },
239+
"confidence": 0.92,
240+
"imageReferenceId": "face.jpg"
241+
}
242+
]
243+
}
244+
```
245+
246+
- `detectedFace.boundingBox`: The bounding box of the detected face in the input image.
247+
- `similarFaces`: A list of similar faces, each with a `faceId`, `boundingBox`, `confidence` score, and an `imageReferenceId` indicating the source image.
248+
249+
250+
## Next steps
251+
252+
Explore how to identify individuals in video content using the [Azure AI Content Understanding video solutions (preview)](../video/overview.md).

0 commit comments

Comments
 (0)