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/cognitive-services/Custom-Vision-Service/use-prediction-api.md
+24-6Lines changed: 24 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,14 +14,17 @@ ms.author: pafarley
14
14
ms.custom: devx-track-csharp
15
15
---
16
16
17
-
# Use your model with the prediction API
17
+
# Call the prediction API
18
+
19
+
After you've train your model, you can test images programmatically by submitting them to the prediction API endpoint. In this guide, you'll learn how to call the prediction API to score an image. You'll learn the different ways you can configure the behavior of this API to meet your needs.
18
20
19
-
After you've train your model, you can test images programmatically by submitting them to the Prediction API endpoint.
20
21
21
22
> [!NOTE]
22
-
> This document demonstrates using C# to submit an image to the Prediction API. For more information and examples, see the [Prediction API reference](https://southcentralus.dev.cognitive.microsoft.com/docs/services/Custom_Vision_Prediction_3.0/operations/5c82db60bf6a2b11a8247c15).
23
+
> This document demonstrates using the .NET client library with C# to submit an image to the Prediction API. For more information and examples, see the [Prediction API reference](https://southcentralus.dev.cognitive.microsoft.com/docs/services/Custom_Vision_Prediction_3.0/operations/5c82db60bf6a2b11a8247c15).
24
+
25
+
## Setup
23
26
24
-
## Publish your trained iteration
27
+
###Publish your trained iteration
25
28
26
29
From the [Custom Vision web page](https://customvision.ai), select your project and then select the __Performance__ tab.
27
30
@@ -33,19 +36,34 @@ Once your model has been successfully published, you'll see a "Published" label
33
36
34
37

35
38
36
-
## Get the URL and prediction key
39
+
###Get the URL and prediction key
37
40
38
41
Once your model has been published, you can retrieve the required information by selecting __Prediction URL__. This will open up a dialog with information for using the Prediction API, including the __Prediction URL__ and __Prediction-Key__.
39
42
40
43

41
44
42
45

43
46
47
+
## Submit data to the service
48
+
49
+
This guide assumes that you already constructed a FaceClient object, named faceClient, with a Face subscription key and endpoint URL. For instructions on how to set up this feature, follow one of the quickstarts.
44
50
45
-
In this guide, you will use a local image, so copy the URL under **If you have an image file**to a temporary location. Copy the corresponding __Prediction-Key__ value as well.
51
+
In this guide, you will use a local image, so download an image you'd like to use. Copy the corresponding __Prediction-Key__ value as well.
46
52
53
+
54
+
The **[PredictImageAsync](https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.cognitiveservices.vision.customvision.prediction.customvisionpredictionclientextensions.predictimageasync?view=azure-dotnet-preview#Microsoft_Azure_CognitiveServices_Vision_CustomVision_Prediction_CustomVisionPredictionClientExtensions_PredictImageAsync_Microsoft_Azure_CognitiveServices_Vision_CustomVision_Prediction_ICustomVisionPredictionClient_System_Guid_System_IO_Stream_System_Nullable_System_Guid__System_String_System_Threading_CancellationToken_)** method.
47
55
## Create the application
48
56
57
+
## Determine how to process the data
58
+
59
+
## Get results from the service
60
+
61
+
[If this is a separate API call, show it here. Then show a sample response value, and explain any parts of the response that aren't intuitive. Explain error cases if they're relevant enough]
62
+
63
+
64
+
---
65
+
66
+
49
67
1. In Visual Studio, create a new C# console application.
50
68
51
69
1. Use the following code as the body of the __Program.cs__ file.
0 commit comments