You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-services/computer-vision/includes/identity-curl-quickstart.md
+81-6Lines changed: 81 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,8 +24,7 @@ Get started with facial recognition using the Face REST API. The Face service pr
24
24
* You'll need the key and endpoint from the resource you create to connect your application to the Face API. You'll paste your key and endpoint into the code below later in the quickstart.
25
25
* You can use the free pricing tier (`F0`) to try the service, and upgrade later to a paid tier for production.
26
26
*[PowerShell version 6.0+](/powershell/scripting/install/installing-powershell-core-on-windows), or a similar command-line application.
27
-
*[cURL](https://curl.haxx.se/) installed.
28
-
27
+
*[cURL](https://curl.se/) installed.
29
28
30
29
31
30
@@ -34,58 +33,134 @@ Get started with facial recognition using the Face REST API. The Face service pr
34
33
> [!NOTE]
35
34
> If you haven't received access to the Face service using the [intake form](https://aka.ms/facerecognition), some of these functions won't work.
36
35
37
-
1. First, call the Detect API on the source face. This is the face that we'll try to identify from the larger group. Copy the following command to a text editor, insert your own key, and then copy it into a shell window and run it.
36
+
1. First, call the Detect API on the source face. This is the face that we'll try to identify from the larger group. Copy the following command to a text editor, insert your own key and endpoint, and then copy it into a shell window and run it.
Save the returned face ID string to a temporary location. You'll use it again at the end.
42
49
43
-
1. Next you'll need to create a **LargePersonGroup**. This object will store the aggregated face data of several persons. Run the following command, inserting your own key. Optionally, change the group's name and metadata in the request body.
50
+
1. Next you'll need to create a **LargePersonGroup** and give it an arbitrary ID that matches regex pattern `^[a-z0-9-_]+$`. This object will store the aggregated face data of several persons. Run the following command, inserting your own key. Optionally, change the group's name and metadata in the request body.
Save the returned ID of the created group to a temporary location.
60
+
---
61
+
62
+
Save the specified ID of the created group to a temporary location.
48
63
49
64
1. Next, you'll create **Person** objects that belong to the group. Run the following command, inserting your own key and the ID of the **LargePersonGroup** from the previous step. This command creates a **Person** named "Family1-Dad".
After you run this command, run it again with different input data to create more **Person** objects: "Family1-Mom", "Family1-Son", "Family1-Daughter", "Family2-Lady", and "Family2-Man".
54
77
55
78
Save the IDs of each **Person** created; it's important to keep track of which person name has which ID.
56
79
57
80
1. Next you'll need to detect new faces and associate them with the **Person** objects that exist. The following command detects a face from the image *Family1-Dad1.jpg* and adds it to the corresponding person. You need to specify the `personId` as the ID that was returned when you created the "Family1-Dad" **Person** object. The image name corresponds to the name of the created **Person**. Also enter the **LargePersonGroup** ID and your key in the appropriate fields.
Then, run the above command again with a different source image and target **Person**. The images available are: *Family1-Dad1.jpg*, *Family1-Dad2.jpg**Family1-Mom1.jpg*, *Family1-Mom2.jpg*, *Family1-Son1.jpg*, *Family1-Son2.jpg*, *Family1-Daughter1.jpg*, *Family1-Daughter2.jpg*, *Family2-Lady1.jpg*, *Family2-Lady2.jpg*, *Family2-Man1.jpg*, and *Family2-Man2.jpg*. Be sure that the **Person** whose ID you specify in the API call matches the name of the image file in the request body.
62
93
63
94
At the end of this step, you should have multiple **Person** objects that each have one or more corresponding faces, detected directly from the provided images.
64
95
65
96
1. Next, train the **LargePersonGroup** with the current face data. The training operation teaches the model how to associate facial features, sometimes aggregated from multiple source images, to each single person. Insert the **LargePersonGroup** ID and your key before running the command.
1. Now you're ready to call the Identify API, using the source face ID from the first step and the **LargePersonGroup** ID. Insert these values into the appropriate fields in the request body, and insert your key.
The response should give you a **Person** ID indicating the person identified with the source face. It should be the ID that corresponds to the "Family1-Dad" person, because the source face is of that person.
74
133
75
134
1. To do face verification, you'll use the **Person** ID returned in the previous step, the **LargePersonGroup** ID, and also the source face ID. Insert these values into the fields in the request body, and insert your key.
The response should give you a boolean verification result along with a confidence value.
80
147
81
148
82
149
83
150
## Clean up resources
84
151
85
-
To delete the **LargePersonGroup** you created in this exercise, run the LargePersonGroup - Delete call.
152
+
To delete the **LargePersonGroup** you created in this exercise, run the [LargePersonGroup - Delete](/rest/api/face/person-group-operations/delete-large-person-group) call.
If you want to clean up and remove an Azure AI services subscription, you can delete the resource or resource group. Deleting the resource group also deletes any other resources associated with it.
0 commit comments