Skip to content

Commit 2e72526

Browse files
committed
change endpoint language; use region-based snippets
1 parent ea86c6b commit 2e72526

File tree

9 files changed

+27
-20
lines changed

9 files changed

+27
-20
lines changed

articles/cognitive-services/Custom-Vision-Service/csharp-tutorial-od.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Open the _Program.cs_ file and inspect the code. [Create environment variables](
4040

4141
[!code-csharp[](~/cognitive-services-dotnet-sdk-samples/CustomVision/ObjectDetection/Program.cs?name=snippet_keys)]
4242

43-
Also, get your Endpoint URL by selecting your Custom Vision resource in the Azure portal. Save it to an environment variable called `CUSTOM_VISION_ENDPOINT`. The script saves a reference to it at the root of your class.
43+
Also, get your Endpoint URL from the Settings page of the Custom Vision website. Save it to an environment variable called `CUSTOM_VISION_ENDPOINT`. The script saves a reference to it at the root of your class.
4444

4545
[!code-csharp[](~/cognitive-services-dotnet-sdk-samples/CustomVision/ObjectDetection/Program.cs?name=snippet_endpoint)]
4646

articles/cognitive-services/Custom-Vision-Service/csharp-tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Open the _Program.cs_ file and inspect the code. [Create environment variables](
3939

4040
[!code-csharp[](~/cognitive-services-dotnet-sdk-samples/CustomVision/ImageClassification/Program.cs?name=snippet_keys)]
4141

42-
Also, get your Endpoint URL by selecting your Custom Vision resource in the Azure portal. Save it to an environment variable called `CUSTOM_VISION_ENDPOINT`. The script saves a reference to it at the root of your class.
42+
Also, get your Endpoint URL from the Settings page of the Custom Vision website. Save it to an environment variable called `CUSTOM_VISION_ENDPOINT`. The script saves a reference to it at the root of your class.
4343

4444
[!code-csharp[](~/cognitive-services-dotnet-sdk-samples/CustomVision/ImageClassification/Program.cs?name=snippet_endpoint)]
4545

articles/cognitive-services/Custom-Vision-Service/go-tutorial-object-detection.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ Create a new file called *sample.go* in your preferred project directory.
4444

4545
### Create the Custom Vision service project
4646

47-
Add the following code to your script to create a new Custom Vision service project. Insert your subscription keys in the appropriate definitions. See the [CreateProject](https://docs.microsoft.com/java/api/com.microsoft.azure.cognitiveservices.vision.customvision.training.trainings.createproject?view=azure-java-stable#com_microsoft_azure_cognitiveservices_vision_customvision_training_Trainings_createProject_String_CreateProjectOptionalParameter_) method to specify other options when you create your project (explained in the [Build a detector](get-started-build-detector.md) web portal guide).
47+
Add the following code to your script to create a new Custom Vision service project. Insert your subscription keys in the appropriate definitions. Also, get your Endpoint URL from the Settings page of the Custom Vision website.
48+
49+
See the [CreateProject](https://docs.microsoft.com/java/api/com.microsoft.azure.cognitiveservices.vision.customvision.training.trainings.createproject?view=azure-java-stable#com_microsoft_azure_cognitiveservices_vision_customvision_training_Trainings_createProject_String_CreateProjectOptionalParameter_) method to specify other options when you create your project (explained in the [Build a detector](get-started-build-detector.md) web portal guide).
4850

4951
```go
5052
import(
@@ -63,7 +65,7 @@ var (
6365
training_key string = "<your training key>"
6466
prediction_key string = "<your prediction key>"
6567
prediction_resource_id = "<your prediction resource id>"
66-
endpoint string = "https://southcentralus.api.cognitive.microsoft.com"
68+
endpoint string = "<your endpoint URL>"
6769
project_name string = "Go Sample OD Project"
6870
iteration_publish_name = "detectModel"
6971
sampleDataDirectory = "<path to sample images>"

articles/cognitive-services/Custom-Vision-Service/go-tutorial.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ Create a new file called *sample.go* in your preferred project directory.
4444

4545
### Create the Custom Vision service project
4646

47-
Add the following code to your script to create a new Custom Vision service project. Insert your subscription keys in the appropriate definitions. See the [CreateProject](https://docs.microsoft.com/java/api/com.microsoft.azure.cognitiveservices.vision.customvision.training.trainings.createproject?view=azure-java-stable#com_microsoft_azure_cognitiveservices_vision_customvision_training_Trainings_createProject_String_CreateProjectOptionalParameter_) method to specify other options when you create your project (explained in the [Build a classifier](getting-started-build-a-classifier.md) web portal guide).
47+
Add the following code to your script to create a new Custom Vision service project. Insert your subscription keys in the appropriate definitions. Also, get your Endpoint URL from the Settings page of the Custom Vision website.
48+
49+
See the [CreateProject](https://docs.microsoft.com/java/api/com.microsoft.azure.cognitiveservices.vision.customvision.training.trainings.createproject?view=azure-java-stable#com_microsoft_azure_cognitiveservices_vision_customvision_training_Trainings_createProject_String_CreateProjectOptionalParameter_) method to specify other options when you create your project (explained in the [Build a classifier](getting-started-build-a-classifier.md) web portal guide).
4850

4951
```go
5052
import(
@@ -63,7 +65,7 @@ var (
6365
training_key string = "<your training key>"
6466
prediction_key string = "<your prediction key>"
6567
prediction_resource_id = "<your prediction resource id>"
66-
endpoint string = "https://southcentralus.api.cognitive.microsoft.com"
68+
endpoint string = "<your endpoint URL>"
6769
project_name string = "Go Sample Project"
6870
iteration_publish_name = "classifyModel"
6971
sampleDataDirectory = "<path to sample images>"

articles/cognitive-services/Custom-Vision-Service/logo-detector-mobile.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ After you upload the training images, select the first one on the display. The t
5252

5353
The app is configured to work with specific tag strings. You'll find the definitions in the *Source\VisualProvision\Services\Recognition\RecognitionService.cs* file:
5454

55-
[!code-csharp[Tag definitions](~/AIVisualProvision/Source/VisualProvision/Services/Recognition/RecognitionService.cs?range=18-33)]
55+
[!code-csharp[Tag definitions](~/AIVisualProvision/Source/VisualProvision/Services/Recognition/RecognitionService.cs?name=snippet_constants)]
5656

5757
After you tag an image, go to the right to tag the next one. Close the tagging window when you finish.
5858

@@ -68,19 +68,19 @@ After your model is trained, you're ready to integrate it into your app. You'll
6868

6969
![The Custom Vision website, showing a Prediction API window that displays a URL address and API key](media/azure-logo-tutorial/cusvis-endpoint.png)
7070

71-
Copy the image file URL and the **Prediction-Key** value to the appropriate fields in the *Source\VisualProvision\AppSettings.cs* file:
71+
Copy the endpoint URL and the **Prediction-Key** value to the appropriate fields in the *Source\VisualProvision\AppSettings.cs* file:
7272

73-
[!code-csharp[Custom Vision fields](~/AIVisualProvision/Source/VisualProvision/AppSettings.cs?range=22-26)]
73+
[!code-csharp[Custom Vision fields](~/AIVisualProvision/Source/VisualProvision/AppSettings.cs?name=snippet_cusvis_keys)]
7474

7575
## Examine Custom Vision usage
7676

7777
Open the *Source/VisualProvision/Services/Recognition/CustomVisionService.cs* file to see how the app uses your Custom Vision key and endpoint URL. The **PredictImageContentsAsync** method takes a byte stream of an image file along with a cancellation token (for asynchronous task management), calls the Custom Vision prediction API, and returns the result of the prediction.
7878

79-
[!code-csharp[Custom Vision fields](~/AIVisualProvision/Source/VisualProvision/Services/Recognition/CustomVisionService.cs?range=12-28)]
79+
[!code-csharp[Custom Vision fields](~/AIVisualProvision/Source/VisualProvision/Services/Recognition/CustomVisionService.cs?name=snippet_prediction)]
8080

8181
This result takes the form of a **PredictionResult** instance, which itself contains a list of **Prediction** instances. A **Prediction** contains a detected tag and its bounding box location in the image.
8282

83-
[!code-csharp[Custom Vision fields](~/AIVisualProvision/Source/VisualProvision/Services/Recognition/Prediction.cs?range=3-12)]
83+
[!code-csharp[Custom Vision fields](~/AIVisualProvision/Source/VisualProvision/Services/Recognition/Prediction.cs?name=snippet_prediction_class)]
8484

8585
To learn more about how the app handles this data, start with the **GetResourcesAsync** method. This method is defined in the *Source/VisualProvision/Services/Recognition/RecognitionService.cs* file.
8686

@@ -94,7 +94,7 @@ Subscribe to the Computer Vision service to get a key and endpoint URL. For help
9494

9595
Next, open the *Source\VisualProvision\AppSettings.cs* file and populate the `ComputerVisionEndpoint` and `ComputerVisionKey` variables with the correct values.
9696

97-
[!code-csharp[Computer Vision fields](~/AIVisualProvision/Source/VisualProvision/AppSettings.cs?range=28-32)]
97+
[!code-csharp[Computer Vision fields](~/AIVisualProvision/Source/VisualProvision/AppSettings.cs?name=snippet_comvis_keys)]
9898

9999
## Create a service principal
100100

@@ -128,7 +128,7 @@ Upon successful completion, you should see the following JSON output, including
128128

129129
Take note of the `clientId` and `tenantId` values. Add them to the appropriate fields in the *Source\VisualProvision\AppSettings.cs* file.
130130

131-
[!code-csharp[Computer Vision fields](~/AIVisualProvision/Source/VisualProvision/AppSettings.cs?range=8-16)]
131+
[!code-csharp[Computer Vision fields](~/AIVisualProvision/Source/VisualProvision/AppSettings.cs?name=snippet_serviceprincipal)]
132132

133133
## Run the app
134134

articles/cognitive-services/Custom-Vision-Service/node-tutorial-object-detection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const predictionKey = "<your prediction key>";
5757
const predictionResourceId = "<your prediction resource id>";
5858
const sampleDataRoot = "<path to image files>";
5959

60-
const endPoint = "https://southcentralus.api.cognitive.microsoft.com"
60+
const endPoint = "https://<my-resource-name>.cognitiveservices.azure.com/"
6161

6262
const publishIterationName = "detectModel";
6363

articles/cognitive-services/Custom-Vision-Service/node-tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const predictionKey = "<your prediction key>";
5656
const predictionResourceId = "<your prediction resource id>";
5757
const sampleDataRoot = "<path to image files>";
5858

59-
const endPoint = "https://southcentralus.api.cognitive.microsoft.com"
59+
const endPoint = "https://<my-resource-name>.cognitiveservices.azure.com/"
6060

6161
const publishIterationName = "classifyModel";
6262

articles/cognitive-services/Custom-Vision-Service/python-tutorial-od.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,15 @@ Create a new file called *sample.py* in your preferred project directory.
4242

4343
### Create the Custom Vision service project
4444

45-
Add the following code to your script to create a new Custom Vision service project. Insert your subscription keys in the appropriate definitions. See the [create_project](https://docs.microsoft.com/python/api/azure-cognitiveservices-vision-customvision/azure.cognitiveservices.vision.customvision.training.custom_vision_training_client.customvisiontrainingclient?view=azure-python#create-project-name--description-none--domain-id-none--classification-type-none--target-export-platforms-none--custom-headers-none--raw-false----operation-config- ) method to specify other options when you create your project (explained in the [Build a detector](get-started-build-detector.md) web portal guide).
45+
Add the following code to your script to create a new Custom Vision service project. Insert your subscription keys in the appropriate definitions. Also, get your Endpoint URL from the Settings page of the Custom Vision website.
46+
47+
See the [create_project](https://docs.microsoft.com/python/api/azure-cognitiveservices-vision-customvision/azure.cognitiveservices.vision.customvision.training.custom_vision_training_client.customvisiontrainingclient?view=azure-python#create-project-name--description-none--domain-id-none--classification-type-none--target-export-platforms-none--custom-headers-none--raw-false----operation-config- ) method to specify other options when you create your project (explained in the [Build a detector](get-started-build-detector.md) web portal guide).
4648

4749
```Python
4850
from azure.cognitiveservices.vision.customvision.training import CustomVisionTrainingClient
4951
from azure.cognitiveservices.vision.customvision.training.models import ImageFileCreateEntry, Region
5052

51-
ENDPOINT = "https://southcentralus.api.cognitive.microsoft.com"
53+
ENDPOINT = "<your API endpoint>"
5254

5355
# Replace with a valid key
5456
training_key = "<your training key>"

articles/cognitive-services/Custom-Vision-Service/python-tutorial.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,21 @@ pip install azure-cognitiveservices-vision-customvision
3434

3535
[!INCLUDE [python-get-images](includes/python-get-images.md)]
3636

37-
3837
## Add the code
3938

4039
Create a new file called *sample.py* in your preferred project directory.
4140

4241
### Create the Custom Vision service project
4342

44-
Add the following code to your script to create a new Custom Vision service project. Insert your subscription keys in the appropriate definitions. See the [create_project](https://docs.microsoft.com/python/api/azure-cognitiveservices-vision-customvision/azure.cognitiveservices.vision.customvision.training.custom_vision_training_client.customvisiontrainingclient?view=azure-python#create-project-name--description-none--domain-id-none--classification-type-none--target-export-platforms-none--custom-headers-none--raw-false----operation-config- ) method to specify other options when you create your project (explained in the [Build a classifier](getting-started-build-a-classifier.md) web portal guide).
43+
Add the following code to your script to create a new Custom Vision service project. Insert your subscription keys in the appropriate definitions. Also, get your Endpoint URL from the Settings page of the Custom Vision website.
44+
45+
See the [create_project](https://docs.microsoft.com/python/api/azure-cognitiveservices-vision-customvision/azure.cognitiveservices.vision.customvision.training.custom_vision_training_client.customvisiontrainingclient?view=azure-python#create-project-name--description-none--domain-id-none--classification-type-none--target-export-platforms-none--custom-headers-none--raw-false----operation-config- ) method to specify other options when you create your project (explained in the [Build a classifier](getting-started-build-a-classifier.md) web portal guide).
4546

4647
```Python
4748
from azure.cognitiveservices.vision.customvision.training import CustomVisionTrainingClient
4849
from azure.cognitiveservices.vision.customvision.training.models import ImageFileCreateEntry
4950

50-
ENDPOINT = "https://southcentralus.api.cognitive.microsoft.com"
51+
ENDPOINT = "<your API endpoint>"
5152

5253
# Replace with a valid key
5354
training_key = "<your training key>"

0 commit comments

Comments
 (0)