Skip to content

Commit a552bdc

Browse files
authored
Merge pull request #188532 from PatrickFarley/face-updates
[cog svcs] Face updates
2 parents e9998fc + 3a64167 commit a552bdc

File tree

10 files changed

+44
-14
lines changed

10 files changed

+44
-14
lines changed

articles/cognitive-services/Face/includes/quickstarts/csharp-sdk.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ From the project directory, open the *program.cs* file and add the following `us
8787

8888
In the application's **Program** class, create variables for your resource's key and endpoint.
8989

90-
9190
> [!IMPORTANT]
9291
> Go to the Azure portal. If the Face resource you created in the **Prerequisites** section deployed successfully, click the **Go to Resource** button under **Next Steps**. You can find your key and endpoint in the resource's **key and endpoint** page, under **resource management**.
93-
>
92+
93+
> [!IMPORTANT]
9494
> Remember to remove the key from your code when you're done, and never post it publicly. For production, consider using a secure way of storing and accessing your credentials. See the Cognitive Services [security](../../../cognitive-services-security.md) article for more information.
9595
9696
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/Face/FaceQuickstart.cs?name=snippet_creds)]
@@ -146,6 +146,12 @@ Create a new method to detect faces. The `DetectFaceExtract` method processes th
146146

147147
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/Face/FaceQuickstart.cs?name=snippet_detect)]
148148

149+
The above code processes the following remote images:
150+
151+
![Photo of a woman smiling](../../media/quickstarts/detection-1.jpg)
152+
![Photo of a man, woman, and baby](../../media/quickstarts/detection-5.jpg)
153+
![Photo of an older man and woman](../../media/quickstarts/detection-6.jpg)
154+
149155
> [!TIP]
150156
> You can also detect faces in a local image. See the [IFaceOperations](/dotnet/api/microsoft.azure.cognitiveservices.vision.face.ifaceoperations) methods such as **DetectWithStreamAsync**.
151157
@@ -220,12 +226,19 @@ The following method detects faces in a set of target images and in a single sou
220226

221227
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/Face/FaceQuickstart.cs?name=snippet_find_similar)]
222228

229+
In this program, the following remote image will be used as the source:
230+
231+
![Photo of a man smiling](../../media/quickstarts/find-similar.jpg)
232+
223233
### Print matches
224234

225235
The following code prints the match details to the console:
226236

227237
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/Face/FaceQuickstart.cs?name=snippet_find_similar_print)]
228238

239+
In this program, the face detected in this image should be returned as the face that's similar to the source image face.
240+
241+
![Photo of a man smiling; this is the same person as the previous image](../../media/quickstarts/family-1-dad-1.jpg)
229242

230243
## Run the application
231244

articles/cognitive-services/Face/includes/quickstarts/javascript-sdk.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ Create variables for your resource's Azure endpoint and key.
7373

7474
> [!IMPORTANT]
7575
> Go to the Azure portal. If the Face resource you created in the **Prerequisites** section deployed successfully, click the **Go to Resource** button under **Next Steps**. You can find your key and endpoint in the resource's **key and endpoint** page, under **resource management**.
76-
>
76+
77+
> [!IMPORTANT]
7778
> Remember to remove the key from your code when you're done, and never post it publicly. For production, consider using a secure way of storing and accessing your credentials. See the Cognitive Services [security](../../../cognitive-services-security.md) article for more information.
7879
7980
```javascript
@@ -139,6 +140,12 @@ The "QualityForRecognition" attribute is an indicator of the overall image quali
139140

140141
:::code language="js" source="~/cognitive-services-quickstart-code/javascript/Face/sdk_quickstart.js" id="detect":::
141142

143+
The above code processes the following remote images:
144+
145+
![Photo of a woman smiling](../../media/quickstarts/detection-1.jpg)
146+
![Photo of a man, woman, and baby](../../media/quickstarts/detection-5.jpg)
147+
![Photo of an older man and woman](../../media/quickstarts/detection-6.jpg)
148+
142149
> [!TIP]
143150
> You can also detect faces in a local image. See the [Face](/javascript/api/@azure/cognitiveservices-face/face) methods such as [DetectWithStreamAsync](/javascript/api/@azure/cognitiveservices-face/face#detectWithStream_msRest_HttpRequestBody__FaceDetectWithStreamOptionalParams__ServiceCallback_DetectedFace____).
144151
@@ -191,6 +198,14 @@ The following method detects faces in a set of target images and in a single sou
191198

192199
:::code language="js" source="~/cognitive-services-quickstart-code/javascript/Face/sdk_quickstart.js" id="find_similar":::
193200

201+
In this program, the following remote image will be used as the source:
202+
203+
![Photo of a man smiling](../../media/quickstarts/find-similar.jpg)
204+
205+
The face detected in this image should be returned as the face that's similar to the source image face.
206+
207+
![Photo of a man smiling; this is the same person as the previous image](../../media/quickstarts/family-1-dad-1.jpg)
208+
194209
## Main
195210

196211
Finally, create the `main` function and call it.

articles/cognitive-services/Face/includes/quickstarts/python-sdk.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ Then, create variables for your resource's Azure endpoint and key.
5656

5757
> [!IMPORTANT]
5858
> Go to the Azure portal. If the Face resource you created in the **Prerequisites** section deployed successfully, click the **Go to Resource** button under **Next Steps**. You can find your key and endpoint in the resource's **key and endpoint** page, under **resource management**.
59-
>
60-
> Remember to remove the key from your code when you're done, and never post it publicly. For production, consider using a secure way of storing and accessing your credentials. For example, [Azure key vault](../../../../key-vault/general/overview.md).
59+
60+
> [!IMPORTANT]
61+
> Remember to remove the key from your code when you're done, and never post it publicly. For production, consider using a secure way of storing and accessing your credentials. See the Cognitive Services [security](../../../cognitive-services-security.md) article for more information.
6162
6263
## Object model
6364

articles/cognitive-services/Face/includes/quickstarts/rest-api.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ Make the following changes:
4343
[!INCLUDE [subdomains-note](../../../../../includes/cognitive-services-custom-subdomains-note.md)]
4444
1. Optionally change the URL in the body of the request to point to a different image.
4545

46-
Once you've made your changes, open a command prompt and enter the new command.
46+
Once you've made your changes, open a command prompt and enter the new command. The code will process the following remote image.
47+
48+
![An older man and woman](../../media/quickstarts/lillian-gish.jpg)
4749

4850
### Examine the results
4951

@@ -90,13 +92,6 @@ The returned face information now includes face attributes. For example:
9092
"roll": 0.1,
9193
"yaw": -32.9
9294
},
93-
"gender": "female",
94-
"age": 22.9,
95-
"facialHair": {
96-
"moustache": 0,
97-
"beard": 0,
98-
"sideburns": 0
99-
},
10095
"glasses": "NoGlasses",
10196
"emotion": {
10297
"anger": 0,
@@ -183,6 +178,8 @@ Finally, detect the single source face that you'll use for matching, and save it
183178

184179
:::code source="~/cognitive-services-quickstart-code/curl/face/detect.sh" ID="similar_matcher":::
185180

181+
![Photo of a man smiling](../../media/quickstarts/find-similar.jpg)
182+
186183
### Find matches
187184

188185
Copy the following command to a text editor.
@@ -202,7 +199,7 @@ Use the following JSON content for the `body` value:
202199

203200
### Examine the results
204201

205-
You'll receive a JSON response that lists the IDs of the faces that match your query face.
202+
You'll receive a JSON response that lists the IDs of the faces that match your query face.
206203

207204
```json
208205
[
@@ -214,6 +211,10 @@ You'll receive a JSON response that lists the IDs of the faces that match your q
214211
]
215212
```
216213

214+
In this program, the face detected in this image should be returned as the face that's similar to the source image face.
215+
216+
![Photo of a man smiling; this is the same person as the previous image](../../media/quickstarts/family-1-dad-1.jpg)
217+
217218
## Clean up resources
218219

219220
If you want to clean up and remove a Cognitive Services subscription, you can delete the resource or resource group. Deleting the resource group also deletes any other resources associated with it.
480 KB
Loading
567 KB
Loading
573 KB
Loading
43.7 KB
Loading
45.5 KB
Loading
110 KB
Loading

0 commit comments

Comments
 (0)