Skip to content

Commit c7a1a2b

Browse files
committed
new quickstart for cs py and js
1 parent 78f5cf2 commit c7a1a2b

File tree

3 files changed

+74
-82
lines changed

3 files changed

+74
-82
lines changed

articles/ai-services/computer-vision/includes/quickstarts-sdk/identity-csharp-sdk.md

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.author: pafarley
1515

1616
Get started with facial recognition using the Face client library for .NET. The Azure AI Face service provides you with access to advanced algorithms for detecting and recognizing human faces in images. Follow these steps to install the package and try out the example code for basic face identification using remote images.
1717

18-
[Reference documentation](/dotnet/api/overview/azure/cognitiveservices/face-readme) | [Library source code](https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/cognitiveservices/Vision.Face) | [Package (NuGet)](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Vision.Face/2.7.0-preview.3) | [Samples](/samples/browse/?products=azure&term=face)
18+
[Reference documentation](https://aka.ms/azsdk-csharp-face-ref) | [Library source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/face/Azure.AI.Vision.Face) | [Package (NuGet)](https://aka.ms/azsdk-csharp-face-pkg) | [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/face/Azure.AI.Vision.Face/samples)
1919

2020
## Prerequisites
2121

@@ -41,7 +41,7 @@ Get started with facial recognition using the Face client library for .NET. The
4141

4242
### Install the client library
4343

44-
Once you've created a new project, install the client library by right-clicking on the project solution in the **Solution Explorer** and selecting **Manage NuGet Packages**. In the package manager that opens select **Browse**, check **Include prerelease**, and search for `Microsoft.Azure.CognitiveServices.Vision.Face`. Select the latest version, and then **Install**.
44+
Once you've created a new project, install the client library by right-clicking on the project solution in the **Solution Explorer** and selecting **Manage NuGet Packages**. In the package manager that opens select **Browse**, check **Include prerelease**, and search for `Azure.AI.Vision.Face`. Select the latest version, and then **Install**.
4545

4646
#### [CLI](#tab/cli)
4747

@@ -72,7 +72,7 @@ Get started with facial recognition using the Face client library for .NET. The
7272
Within the application directory, install the Face client library for .NET with the following command:
7373

7474
```console
75-
dotnet add package Microsoft.Azure.CognitiveServices.Vision.Face --prerelease
75+
dotnet add package Azure.AI.Vision.Face --prerelease
7676
```
7777

7878
---
@@ -81,7 +81,7 @@ Get started with facial recognition using the Face client library for .NET. The
8181
> [!NOTE]
8282
> 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.
8383
84-
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/Face/FaceQuickstart-single.cs?name=snippet_single)]
84+
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/Face/Quickstart.cs?name=snippet_single)]
8585

8686

8787
1. Run the application
@@ -107,32 +107,39 @@ Get started with facial recognition using the Face client library for .NET. The
107107
```console
108108
========IDENTIFY FACES========
109109

110-
Create a person group (3972c063-71b3-4328-8579-6d190ee76f99).
110+
Create a person group (18d1c443-a01b-46a4-9191-121f74a831cd).
111111
Create a person group person 'Family1-Dad'.
112+
Check whether image is of sufficient quality for recognition
112113
Add face to the person group person(Family1-Dad) from image `Family1-Dad1.jpg`
114+
Check whether image is of sufficient quality for recognition
113115
Add face to the person group person(Family1-Dad) from image `Family1-Dad2.jpg`
114116
Create a person group person 'Family1-Mom'.
117+
Check whether image is of sufficient quality for recognition
115118
Add face to the person group person(Family1-Mom) from image `Family1-Mom1.jpg`
119+
Check whether image is of sufficient quality for recognition
116120
Add face to the person group person(Family1-Mom) from image `Family1-Mom2.jpg`
117121
Create a person group person 'Family1-Son'.
122+
Check whether image is of sufficient quality for recognition
118123
Add face to the person group person(Family1-Son) from image `Family1-Son1.jpg`
124+
Check whether image is of sufficient quality for recognition
119125
Add face to the person group person(Family1-Son) from image `Family1-Son2.jpg`
120-
Create a person group person 'Family1-Daughter'.
121-
Create a person group person 'Family2-Lady'.
122-
Add face to the person group person(Family2-Lady) from image `Family2-Lady1.jpg`
123-
Add face to the person group person(Family2-Lady) from image `Family2-Lady2.jpg`
124-
Create a person group person 'Family2-Man'.
125-
Add face to the person group person(Family2-Man) from image `Family2-Man1.jpg`
126-
Add face to the person group person(Family2-Man) from image `Family2-Man2.jpg`
127126

128-
Train person group 3972c063-71b3-4328-8579-6d190ee76f99.
129-
Training status: Succeeded.
127+
Train person group 18d1c443-a01b-46a4-9191-121f74a831cd.
128+
Training status: succeeded.
130129

130+
Pausing for 60 seconds to avoid triggering rate limit on free account...
131131
4 face(s) with 4 having sufficient quality for recognition detected from image `identification1.jpg`
132-
Person 'Family1-Dad' is identified for face in: identification1.jpg - 994bfd7a-0d8f-4fae-a5a6-c524664cbee7, confidence: 0.96725.
133-
Person 'Family1-Mom' is identified for face in: identification1.jpg - 0c9da7b9-a628-429d-97ff-cebe7c638fb5, confidence: 0.96921.
134-
No person is identified for face in: identification1.jpg - a881259c-e811-4f7e-a35e-a453e95ca18f,
135-
Person 'Family1-Son' is identified for face in: identification1.jpg - 53772235-8193-46eb-bdfc-1ebc25ea062e, confidence: 0.92886.
132+
Person 'Family1-Dad' is identified for the face in: identification1.jpg - ad813534-9141-47b4-bfba-24919223966f, confidence: 0.96807.
133+
Verification result: is a match? True. confidence: 0.96807
134+
Person 'Family1-Mom' is identified for the face in: identification1.jpg - 1a39420e-f517-4cee-a898-5d968dac1a7e, confidence: 0.96902.
135+
Verification result: is a match? True. confidence: 0.96902
136+
No person is identified for the face in: identification1.jpg - 889394b1-e30f-4147-9be1-302beb5573f3,
137+
Person 'Family1-Son' is identified for the face in: identification1.jpg - 0557d87b-356c-48a8-988f-ce0ad2239aa5, confidence: 0.9281.
138+
Verification result: is a match? True. confidence: 0.9281
139+
140+
========DELETE PERSON GROUP========
141+
142+
Deleted the person group 18d1c443-a01b-46a4-9191-121f74a831cd.
136143

137144
End of quickstart.
138145
```
@@ -149,14 +156,6 @@ If you want to clean up and remove an Azure AI services subscription, you can de
149156
* [Portal](../../../multi-service-resource.md?pivots=azportal#clean-up-resources)
150157
* [Azure CLI](../../../multi-service-resource.md?pivots=azcli#clean-up-resources)
151158

152-
To delete the **PersonGroup** you created in this quickstart, run the following code in your program:
153-
154-
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/Face/FaceQuickstart.cs?name=snippet_persongroup_delete)]
155-
156-
Define the deletion method with the following code:
157-
158-
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/Face/FaceQuickstart.cs?name=snippet_deletepersongroup)]
159-
160159
## Next steps
161160

162161
In this quickstart, you learned how to use the Face client library for .NET to do basic face identification. Next, learn about the different face detection models and how to specify the right model for your use case.
@@ -165,4 +164,4 @@ In this quickstart, you learned how to use the Face client library for .NET to d
165164
> [Specify a face detection model version](../../how-to/specify-detection-model.md)
166165
167166
* [What is the Face service?](../../overview-identity.md)
168-
* More extensive sample code can be found on [GitHub](https://github.com/Azure-Samples/cognitive-services-quickstart-code/blob/master/dotnet/Face/FaceQuickstart.cs).
167+
* More extensive sample code can be found on [GitHub](https://aka.ms/FaceSamples).

articles/ai-services/computer-vision/includes/quickstarts-sdk/identity-javascript-sdk.md

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Get started with facial recognition using the Face client library for JavaScript
6161
> [!NOTE]
6262
> 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.
6363

64-
:::code language="js" source="~/cognitive-services-quickstart-code/javascript/Face/sdk_quickstart-single.js" id="snippet_single":::
64+
:::code language="js" source="~/cognitive-services-quickstart-code/javascript/Face/Quickstart.js" id="snippet_single":::
6565

6666
1. Run the application with the `node` command on your quickstart file.
6767

@@ -76,37 +76,31 @@ Get started with facial recognition using the Face client library for JavaScript
7676
```console
7777
========IDENTIFY FACES========
7878

79-
Creating a person group with ID: c08484e0-044b-4610-8b7e-c957584e5d2d
79+
Creating a person group with ID: a230ac8b-09b2-4fa0-ae04-d76356d88d9f
8080
Adding faces to person group...
81-
Create a persongroup person: Family1-Dad.
82-
Create a persongroup person: Family1-Mom.
83-
Create a persongroup person: Family2-Lady.
84-
Create a persongroup person: Family1-Son.
85-
Create a persongroup person: Family1-Daughter.
86-
Create a persongroup person: Family2-Man.
87-
Add face to the person group person: (Family1-Son) from image: Family1-Son2.jpg.
88-
Add face to the person group person: (Family1-Dad) from image: Family1-Dad2.jpg.
89-
Add face to the person group person: (Family1-Mom) from image: Family1-Mom1.jpg.
90-
Add face to the person group person: (Family2-Man) from image: Family2-Man1.jpg.
91-
Add face to the person group person: (Family1-Son) from image: Family1-Son1.jpg.
92-
Add face to the person group person: (Family2-Lady) from image: Family2-Lady2.jpg.
93-
Add face to the person group person: (Family1-Mom) from image: Family1-Mom2.jpg.
94-
Add face to the person group person: (Family1-Dad) from image: Family1-Dad1.jpg.
95-
Add face to the person group person: (Family2-Man) from image: Family2-Man2.jpg.
96-
Add face to the person group person: (Family2-Lady) from image: Family2-Lady1.jpg.
81+
Create a persongroup person: Family1-Dad
82+
Create a persongroup person: Family1-Mom
83+
Create a persongroup person: Family1-Son
84+
Add face to the person group person: (Family1-Dad) from image: (Family1-Dad1.jpg)
85+
Add face to the person group person: (Family1-Mom) from image: (Family1-Mom1.jpg)
86+
Add face to the person group person: (Family1-Son) from image: (Family1-Son1.jpg)
87+
Add face to the person group person: (Family1-Dad) from image: (Family1-Dad2.jpg)
88+
Add face to the person group person: (Family1-Mom) from image: (Family1-Mom2.jpg)
89+
Add face to the person group person: (Family1-Son) from image: (Family1-Son2.jpg)
9790
Done adding faces to person group.
9891

99-
Training person group: c08484e0-044b-4610-8b7e-c957584e5d2d.
100-
Training status: succeeded.
101-
No persons identified for face with ID 259dd648-be70-499c-9942-3512594e21eb
102-
Person: Family1-Mom is identified for face in: identification1.jpg with ID: b7f7f542-c338-4a40-ad52-e61772bc6e14. Confidence: 0.96921.
103-
Person: Family1-Son is identified for face in: identification1.jpg with ID: 600dc1b4-b2c4-4516-87de-edbbdd8d7632. Confidence: 0.92886.
104-
Person: Family1-Dad is identified for face in: identification1.jpg with ID: e83b494f-9ad2-473f-9d86-3de79c01e345. Confidence: 0.96725.
105-
Verification result between face bb7f7f542-c338-4a40-ad52-e61772bc6e14 and person de1d7dea-a393-4f69-9062-10cb66d4cf17: true with confidence: 0.96921
106-
Verification result between face 600dc1b4-b2c4-4516-87de-edbbdd8d7632 and person 05fd84e4-41b0-4716-b767-4376e33fa207: true with confidence: 0.92886
107-
Verification result between face e83b494f-9ad2-473f-9d86-3de79c01e345 and person c5124fe2-39dd-47ba-9163-1ed2998fdeb2: true with confidence: 0.96725
92+
Training person group: a230ac8b-09b2-4fa0-ae04-d76356d88d9f
93+
Training status: succeeded
94+
Pausing for 60 seconds to avoid triggering rate limit on free account...
95+
No persons identified for face with ID 56380623-8bf0-414a-b9d9-c2373386b7be
96+
Person: Family1-Dad is identified for face in: identification1.jpg with ID: c45052eb-a910-4fd3-b1c3-f91ccccc316a. Confidence: 0.96807
97+
Person: Family1-Son is identified for face in: identification1.jpg with ID: 8dce9b50-513f-4fe2-9e19-352acfd622b3. Confidence: 0.9281
98+
Person: Family1-Mom is identified for face in: identification1.jpg with ID: 75868da3-66f6-4b5f-a172-0b619f4d74c1. Confidence: 0.96902
99+
Verification result between face c45052eb-a910-4fd3-b1c3-f91ccccc316a and person 35a58d14-fd58-4146-9669-82ed664da357: true with confidence: 0.96807
100+
Verification result between face 8dce9b50-513f-4fe2-9e19-352acfd622b3 and person 2d4d196c-5349-431c-bf0c-f1d7aaa180ba: true with confidence: 0.9281
101+
Verification result between face 75868da3-66f6-4b5f-a172-0b619f4d74c1 and person 35d5de9e-5f92-4552-8907-0d0aac889c3e: true with confidence: 0.96902
108102

109-
Deleting person group: c08484e0-044b-4610-8b7e-c957584e5d2d
103+
Deleting person group: a230ac8b-09b2-4fa0-ae04-d76356d88d9f
110104

111105
Done.
112106
```
@@ -127,4 +121,4 @@ In this quickstart, you learned how to use the Face client library for JavaScrip
127121
> [Specify a face detection model version](../../how-to/specify-detection-model.md)
128122
129123
* [What is the Face service?](../../overview-identity.md)
130-
* More extensive sample code can be found on [GitHub](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/face/ai-vision-face-rest/samples).
124+
* More extensive sample code can be found on [GitHub](https://aka.ms/FaceSamples).

articles/ai-services/computer-vision/includes/quickstarts-sdk/identity-python-sdk.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.author: pafarley
1515

1616
Get started with facial recognition using the Face client library for Python. Follow these steps to install the package and try out the example code for basic tasks. The Face service provides you with access to advanced algorithms for detecting and recognizing human faces in images. Follow these steps to install the package and try out the example code for basic face identification using remote images.
1717

18-
[Reference documentation](/python/api/overview/azure/cognitiveservices/face-readme) | [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](/samples/browse/?products=azure&term=face)
18+
[Reference documentation](https://aka.ms/azsdk-python-face-ref) | [Library source code](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/face/azure-ai-vision-face) | [Package (PiPy)](https://aka.ms/azsdk-python-face-pkg) | [Samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/face/azure-ai-vision-face/samples)
1919

2020
## Prerequisites
2121

@@ -39,7 +39,7 @@ Get started with facial recognition using the Face client library for Python. Fo
3939
After installing Python, you can install the client library with:
4040

4141
```console
42-
pip install --upgrade azure-cognitiveservices-vision-face
42+
pip install --upgrade azure-ai-vision-face
4343
```
4444

4545
1. Create a new Python application
@@ -49,7 +49,7 @@ Get started with facial recognition using the Face client library for Python. Fo
4949
> [!NOTE]
5050
> 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.
5151

52-
[!code-python[](~/cognitive-services-quickstart-code/python/Face/FaceQuickstart-single.py?name=snippet_single)]
52+
[!code-python[](~/cognitive-services-quickstart-code/python/Face/Quickstart.py?name=snippet_single)]
5353

5454

5555
1. Run your face recognition app from the application directory with the `python` command.
@@ -66,25 +66,28 @@ Get started with facial recognition using the Face client library for Python. Fo
6666
## Output
6767

6868
```console
69-
Person group: c8e679eb-0b71-43b4-aa91-ab8200cae7df
70-
face 861d769b-d014-40e8-8b4a-7fd3bc9b425b added to person f80c1cfa-b8cb-46f8-9f7f-e72fbe402bc3
71-
face e3c356a4-1ac3-4c97-9219-14648997f195 added to person f80c1cfa-b8cb-46f8-9f7f-e72fbe402bc3
72-
face f9119820-c374-4c4d-b795-96ae2fec5069 added to person be4084a7-0c7b-4cf9-9463-3756d2e28e17
73-
face 67d626df-3f75-4801-9364-601b63c8296a added to person be4084a7-0c7b-4cf9-9463-3756d2e28e17
74-
face 19e2e8cc-5029-4087-bca0-9f94588fb850 added to person 3ff07c65-6193-4d3e-bf18-d7c106393cd5
75-
face dcc61e80-16b1-4241-ae3f-9721597bae4c added to person 3ff07c65-6193-4d3e-bf18-d7c106393cd5
76-
pg resource is c8e679eb-0b71-43b4-aa91-ab8200cae7df
77-
<msrest.pipeline.ClientRawResponse object at 0x00000240DAD47310>
78-
Training status: running.
79-
80-
Training status: succeeded.
81-
82-
Pausing for 10 seconds to avoid triggering rate limit on free account...
69+
Person group: ad12b2db-d892-48ec-837a-0e7168c18224
70+
face 335a2cb1-5211-4c29-9c45-776dd014b2af added to person 9ee65510-81a5-47e5-9e50-66727f719465
71+
face df57eb50-4a13-4f93-b804-cd108327ad5a added to person 9ee65510-81a5-47e5-9e50-66727f719465
72+
face d8b7b8b8-3ca6-4309-b76e-eeed84f7738a added to person 00651036-4236-4004-88b9-11466c251548
73+
face dffbb141-f40b-4392-8785-b6c434fa534e added to person 00651036-4236-4004-88b9-11466c251548
74+
face 9cdac36e-5455-447b-a68d-eb1f5e2ec27d added to person 23614724-b132-407a-aaa0-67003987ce93
75+
face d8208412-92b7-4b8d-a2f8-3926c839c87e added to person 23614724-b132-407a-aaa0-67003987ce93
76+
Train the person group ad12b2db-d892-48ec-837a-0e7168c18224
77+
The person group ad12b2db-d892-48ec-837a-0e7168c18224 is trained successfully.
78+
Pausing for 60 seconds to avoid triggering rate limit on free account...
8379
Identifying faces in image
84-
Person for face ID 40582995-d3a8-41c4-a9d1-d17ae6b46c5c is identified in image, with a confidence of 0.96725.
85-
Person for face ID 7a0368a2-332c-4e7a-81c4-2db3d74c78c5 is identified in image, with a confidence of 0.96921.
86-
No person identified for face ID c4a3dd28-ef2d-457e-81d1-a447344242c4 in image.
87-
Person for face ID 360edf1a-1e8f-402d-aa96-1734d0c21c1c is identified in image, with a confidence of 0.92886.
80+
Person is identified for face ID bc52405a-5d83-4500-9218-557468ccdf99 in image, with a confidence of 0.96726.
81+
verification result: True. confidence: 0.96726
82+
Person is identified for face ID dfcc3fc8-6252-4f3a-8205-71466f39d1a7 in image, with a confidence of 0.96925.
83+
verification result: True. confidence: 0.96925
84+
No person identified for face ID 401c581b-a178-45ed-8205-7692f6eede88 in image.
85+
Person is identified for face ID 8809d9c7-e362-4727-8c95-e1e44f5c2e8a in image, with a confidence of 0.92898.
86+
verification result: True. confidence: 0.92898
87+
88+
The person group ad12b2db-d892-48ec-837a-0e7168c18224 is deleted.
89+
90+
End of quickstart.
8891
```
8992

9093

@@ -96,10 +99,6 @@ If you want to clean up and remove an Azure AI services subscription, you can de
9699
* [Portal](../../../multi-service-resource.md?pivots=azportal#clean-up-resources)
97100
* [Azure CLI](../../../multi-service-resource.md?pivots=azcli#clean-up-resources)
98101

99-
To delete the **PersonGroup** you created in this quickstart, run the following code in your script:
100-
101-
[!code-python[](~/cognitive-services-quickstart-code/python/Face/FaceQuickstart.py?name=snippet_deletegroup)]
102-
103102
## Next steps
104103

105104
In this quickstart, you learned how to use the Face client library for Python to do basic face identification. Next, learn about the different face detection models and how to specify the right model for your use case.
@@ -108,4 +107,4 @@ In this quickstart, you learned how to use the Face client library for Python to
108107
> [Specify a face detection model version](../../how-to/specify-detection-model.md)
109108
110109
* [What is the Face service?](../../overview-identity.md)
111-
* More extensive sample code can be found on [GitHub](https://github.com/Azure-Samples/cognitive-services-quickstart-code/blob/master/python/Face/FaceQuickstart.py).
110+
* More extensive sample code can be found on [GitHub](https://aka.ms/FaceSamples).

0 commit comments

Comments
 (0)