@@ -21,6 +21,7 @@ Use the Face client library for Python to:
21
21
* Find similar faces
22
22
* Create and train a person group
23
23
* Identify a face
24
+ * Verify faces
24
25
* Take a snapshot for data migration
25
26
26
27
[ Reference documentation] ( https://docs.microsoft.com/python/api/azure-cognitiveservices-vision-face/?view=azure-python ) | [ Library source code] ( https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/cognitiveservices/azure-cognitiveservices-vision-face ) | [ Package (PiPy)] ( https://pypi.org/project/azure-cognitiveservices-vision-face/ ) | [ Samples] ( https://azure.microsoft.com/resources/samples/?service=cognitive-services&term=Face&sort=0 )
@@ -85,6 +86,7 @@ These code snippets show you how to do the following tasks with the Face client
85
86
* [ Find similar faces] ( #find-similar-faces )
86
87
* [ Create and train a person group] ( #create-and-train-a-person-group )
87
88
* [ Identify a face] ( #identify-a-face )
89
+ * [ Verify faces] ( #verify-faces )
88
90
* [ Take a snapshot for data migration] ( #take-a-snapshot-for-data-migration )
89
91
90
92
## Authenticate the client
@@ -181,6 +183,32 @@ The **identify** method takes an array of detected faces and compares them to a
181
183
182
184
[ !code-python[ ] ( ~/cognitive-services-quickstart-code/python/Face/FaceQuickstart.py?name=snippet_identify )]
183
185
186
+ ## Verify faces
187
+
188
+ The Verify operation takes a face ID and either another face ID or a ** Person** object and determines whether they belong to the same person.
189
+
190
+ The following code detects faces in two source images and then verifies them against a face detected from a target image.
191
+
192
+ ### Get test images
193
+
194
+ The following code blocks declare variables that will point to the source and target images for the verification operation.
195
+
196
+ [ !code-python[ ] ( ~/cognitive-services-quickstart-code/python/Face/FaceQuickstart.py?name=snippet_verify_baseurl )]
197
+
198
+ [ !code-python[ ] ( ~/cognitive-services-quickstart-code/python/Face/FaceQuickstart.py?name=snippet_verify_photos )]
199
+
200
+ ### Detect faces for verification
201
+
202
+ The following code detects faces in the source and target images and saves them to variables.
203
+
204
+ [ !code-python[ ] ( ~/cognitive-services-quickstart-code/python/Face/FaceQuickstart.py?name=snippet_verify_detect )]
205
+
206
+ ### Get verification results
207
+
208
+ The following code compares each of the source images to the target image and prints a message indicating whether they belong to the same person.
209
+
210
+ [ !code-python[ ] ( ~/cognitive-services-quickstart-code/python/Face/FaceQuickstart.py?name=snippet_verify )]
211
+
184
212
## Take a snapshot for data migration
185
213
186
214
The Snapshots feature lets you move your saved face data, such as a trained ** PersonGroup** , to a different Azure Cognitive Services Face subscription. You may want to use this feature if, for example, you've created a ** PersonGroup** object using a free trial subscription and now want to migrate it to a paid subscription. See the [ Migrate your face data] ( ../Face-API-How-to-Topics/how-to-migrate-face-data.md ) for a broad overview of the Snapshots feature.
0 commit comments