Skip to content

Commit 6669108

Browse files
authored
Merge pull request #247395 from TimShererWithAquent/us141588a
Azure OpenAI Freshness Pass - User Story: 141588
2 parents 18b992c + 572a7a2 commit 6669108

File tree

9 files changed

+170
-170
lines changed

9 files changed

+170
-170
lines changed

articles/ai-services/computer-vision/includes/curl-quickstart.md

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,73 +8,75 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: computer-vision
1010
ms.topic: include
11-
ms.date: 04/19/2021
11+
ms.date: 08/07/2023
1212
ms.author: pafarley
1313
ms.custom: seodec18
1414
---
1515

16-
Use the Optical character recognition REST API to read printed and handwritten text.
16+
Use the optical character recognition (OCR) REST API to read printed and handwritten text.
1717

1818
> [!NOTE]
1919
> This quickstart uses cURL commands to call the REST API. You can also call the REST API using a programming language. See the GitHub samples for examples in [C#](https://github.com/Azure-Samples/cognitive-services-quickstart-code/tree/master/dotnet/ComputerVision/REST), [Python](https://github.com/Azure-Samples/cognitive-services-quickstart-code/tree/master/python/ComputerVision/REST), [Java](https://github.com/Azure-Samples/cognitive-services-quickstart-code/tree/master/java/ComputerVision/REST), and [JavaScript](https://github.com/Azure-Samples/cognitive-services-quickstart-code/tree/master/javascript/ComputerVision/REST).
2020
2121
## Prerequisites
2222

23-
* An Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services/)
24-
* Once you have your Azure subscription, <a href="https://portal.azure.com/#create/Microsoft.CognitiveServicesComputerVision" title="create a Vision resource" target="_blank">create a Vision resource</a> in the Azure portal to get your key and endpoint. After it deploys, select **Go to resource**.
25-
* You will need the key and endpoint from the resource you create to connect your application to the Azure AI Vision service. You'll paste your key and endpoint into the code below later in the quickstart.
26-
* You can use the free pricing tier (`F0`) to try the service, and upgrade later to a paid tier for production.
27-
* [cURL](https://curl.haxx.se/) installed
28-
23+
- An Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services/).
24+
- [cURL](https://curl.haxx.se/) installed.
25+
- <a href="https://portal.azure.com/#create/Microsoft.CognitiveServicesComputerVision" title="create a Vision resource" target="_blank">An Azure AI Vision resource</a>. You can use the free pricing tier (`F0`) to try the service, and upgrade later to a paid tier for production.
26+
- The key and endpoint from the resource you create to connect your application to the Azure AI Vision service.
2927

28+
1. After your Azure Vision resource deploys, select **Go to resource**.
29+
1. In the left navigation menu, select **Keys and Endpoint**.
30+
1. Copy one of the keys and the **Endpoint** for use later in the quickstart.
3031

3132
## Read printed and handwritten text
3233

33-
The OCR service can extract visible text in an image or document and convert it to a character stream. For more information on text extraction, see the [Optical character recognition (OCR) overview](../overview-ocr.md).
34-
34+
The optical character recognition (OCR) service can extract visible text in an image or document and convert it to a character stream. For more information on text extraction, see the [OCR overview](../overview-ocr.md).
3535

3636
### Call the Read API
3737

3838
To create and run the sample, do the following steps:
3939

4040
1. Copy the following command into a text editor.
4141
1. Make the following changes in the command where needed:
42-
1. Replace the value of `<subscriptionKey>` with your key.
43-
1. Replace the first part of the request URL (`westcentralus`) with the text in your own endpoint URL.
42+
43+
1. Replace the value of `<key>` with your key.
44+
1. Replace the first part of the request URL (`https://westcentralus.api.cognitive.microsoft.com/`) with the text in your own endpoint URL.
4445
[!INCLUDE [Custom subdomains notice](../../../../includes/cognitive-services-custom-subdomains-note.md)]
45-
1. Optionally, change the image URL in the request body (`https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/Atomist_quote_from_Democritus.png/338px-Atomist_quote_from_Democritus.png\`) to the URL of a different image to be analyzed.
46-
1. Open a command prompt window.
47-
1. Paste the command from the text editor into the command prompt window, and then run the command.
46+
1. Optionally, change the image URL in the request body (`https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/Atomist_quote_from_Democritus.png/338px-Atomist_quote_from_Democritus.png\`) to the URL of a different image to be analyzed.
4847

49-
```bash
50-
curl -v -X POST "https://westcentralus.api.cognitive.microsoft.com/vision/v3.2/read/analyze" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: <subscription key>" --data-ascii "{\"url\":\"https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/Atomist_quote_from_Democritus.png/338px-Atomist_quote_from_Democritus.png\"}"
51-
```
48+
1. Open a console window.
49+
1. Paste the command from the text editor into the console window, and then run the command.
50+
51+
```bash
52+
curl -v -X POST "https://westcentralus.api.cognitive.microsoft.com/vision/v3.2/read/analyze" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: <key>" --data-ascii "{\"url\":\"https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/Atomist_quote_from_Democritus.png/338px-Atomist_quote_from_Democritus.png\"}"
53+
```
5254

53-
The response will include an `Operation-Location` header, whose value is a unique URL. You use this URL to query the results of the Read operation. The URL expires in 48 hours.
55+
The response includes an `Operation-Location` header, whose value is a unique URL. You use this URL to query the results of the Read operation. The URL expires in 48 hours.
5456

5557
### Optionally, specify the model version
56-
As an optional step, see [How to specify the model version](../how-to/call-read-api.md#determine-how-to-process-the-data-optional). For example, to explicitly specify the latest GA model, use `model-version=2022-04-30` as the parameter. Skipping the parameter or using `model-version=latest` automatically uses the most recent GA model.
58+
59+
As an optional step, see [Determine how to process the data](../how-to/call-read-api.md#determine-how-to-process-the-data-optional). For example, to explicitly specify the latest GA model, use `model-version=2022-04-30` as the parameter. Skipping the parameter or using `model-version=latest` automatically uses the most recent GA model.
60+
5761
```bash
5862
curl -v -X POST "https://westcentralus.api.cognitive.microsoft.com/vision/v3.2/read/analyze?model-version=2022-04-30" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: <subscription key>" --data-ascii "{\"url\":\"https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/Atomist_quote_from_Democritus.png/338px-Atomist_quote_from_Democritus.png\"}"
5963
```
6064

6165
### Get Read results
6266

6367
1. Copy the following command into your text editor.
64-
1. Replace the URL with the `Operation-Location` value you copied in the previous step.
65-
1. Make the following changes in the command where needed:
66-
1. Replace the value of `<subscriptionKey>` with your subscription key.
67-
1. Open a command prompt window.
68-
1. Paste the command from the text editor into the command prompt window, and then run the command.
69-
70-
```bash
71-
curl -v -X GET "https://westcentralus.api.cognitive.microsoft.com/vision/v3.2/read/analyzeResults/{operationId}" -H "Ocp-Apim-Subscription-Key: {subscription key}" --data-ascii "{body}"
72-
```
68+
1. Replace the URL with the `Operation-Location` value you copied in the previous procedure.
69+
1. Replace the value of `<key>` with your key.
70+
1. Open a console window.
71+
1. Paste the command from the text editor into the console window, and then run the command.
7372

73+
```bash
74+
curl -v -X GET "https://westcentralus.api.cognitive.microsoft.com/vision/v3.2/read/analyzeResults/{operationId}" -H "Ocp-Apim-Subscription-Key: {key}" --data-ascii "{body}"
75+
```
7476

7577
### Examine the response
7678

77-
A successful response is returned in JSON. The sample application parses and displays a successful response in the command prompt window, similar to the following example:
79+
A successful response is returned in JSON. The sample application parses and displays a successful response in the console window, similar to the following example:
7880

7981
```json
8082
{
@@ -134,7 +136,12 @@ A successful response is returned in JSON. The sample application parses and dis
134136

135137
```
136138

139+
## Clean up resources
140+
141+
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.
137142

143+
- [Clean up resources with the Azure portal](../../multi-service-resource.md?pivots=azportal#clean-up-resources)
144+
- [Clean up resources with Azure CLI](../../multi-service-resource.md?pivots=azcli#clean-up-resources)
138145

139146
## Next steps
140147

articles/ai-services/computer-vision/includes/environment-variables.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ author: PatrickFarley
33
ms.service: cognitive-services
44
ms.subservice: computer-vision
55
ms.topic: include
6-
ms.date: 02/22/2023
6+
ms.date: 08/07/2023
77
ms.author: pafarley
88
---
99

1010
## Create environment variables
1111

12-
In this example, you'll write your credentials to environment variables on the local machine running the application.
12+
In this example, write your credentials to environment variables on the local machine that runs the application.
1313

1414
[!INCLUDE [find key and endpoint](./find-key.md)]
1515

1616
> [!TIP]
1717
> Don't include the key directly in your code, and never post it publicly. See the Azure AI services [security](../../security-features.md) article for more authentication options like [Azure Key Vault](../../use-key-vault.md).
1818
19-
To set the environment variable for your key and endpoint, open a console window and follow the instructions for your operating system and development environment.
19+
To set the environment variable for your key and endpoint, open a console window and follow the instructions for your operating system and development environment.
2020

2121
1. To set the `VISION_KEY` environment variable, replace `your-key` with one of the keys for your resource.
2222
2. To set the `VISION_ENDPOINT` environment variable, replace `your-endpoint` with the endpoint for your resource.

articles/ai-services/computer-vision/includes/find-key.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: computer-vision
1010
ms.topic: include
11-
ms.date: 03/23/2022
11+
ms.date: 08/07/2023
1212
ms.author: pafarley
1313
---
1414

15-
Go to the Azure portal. If the 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**. Your resource key is not the same as your Azure subscription ID.
15+
Go to the Azure portal. If the resource you created in the **Prerequisites** section deployed successfully, select **Go to resource** under **Next Steps**. You can find your key and endpoint under **Resource Management** in the **Keys and Endpoint** page. Your resource key isn't the same as your Azure subscription ID.

articles/ai-services/computer-vision/includes/ocr-studio-quickstart.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,31 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: computer-vision
1111
ms.topic: include
12-
ms.date: 06/13/2022
12+
ms.date: 08/07/2023
1313
ms.author: pafarley
1414
---
1515

1616
## Prerequisites
1717

18-
* Sign in to [Vision Studio](https://portal.vision.cognitive.azure.com/) with your Azure subscription and Azure AI services resource. See the [Get started section](../overview-vision-studio.md#get-started-using-vision-studio) of the overview if you need help with this step.
18+
- An Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services/).
19+
- [An Azure AI Vision resource](https://portal.azure.com/#create/Microsoft.CognitiveServicesComputerVision). You can use the free pricing tier (`F0`) to try the service, and upgrade later to a paid tier for production.
20+
- Connect to [Vision Studio](https://portal.vision.cognitive.azure.com/).
1921

22+
- You might need to sign in.
23+
- After you sign in, select **View all resources**. If necessary, select **Refresh**. Verify that your resource is available.
2024

25+
For more information, see [Get started using Vision Studio](../overview-vision-studio.md#get-started-using-vision-studio).
2126

2227
## Read printed and handwritten text
2328

24-
1. Select the **Extract text** tab, and select panel titled **Extract text from images**.
25-
1. To use the try-it-out experience, you'll need to choose a resource and acknowledge it will incur usage according to your [pricing tier](https://azure.microsoft.com/pricing/details/cognitive-services/computer-vision/).
29+
1. Under **Optical character recognition**, select **Extract text from images**.
30+
1. Under **Try it out**, acknowledge that this demo incurs usage to your Azure account. For more information, see [Azure AI Vision pricing](https://azure.microsoft.com/pricing/details/cognitive-services/computer-vision/).
2631
1. Select an image from the available set, or upload your own.
27-
1. After you select your image, you'll see the extracted text appear in the output window. You can also select the **JSON** tab to see the JSON output that the API call returns.
28-
1. Below the try-it-out experience are next steps to start using this capability in your own application.
32+
1. If necessary, select **Please select a resource** to select your resource.
2933

34+
After you select your image, the extracted text appears in the output window. You can also select the **JSON** tab to see the JSON output that the API call returns.
3035

36+
Below the try-it-out experience are next steps to start using this capability in your own application.
3137

3238
## Next steps
3339

@@ -36,4 +42,4 @@ In this quickstart, you used Vision Studio to access the Read API. Next, learn m
3642
> [!div class="nextstepaction"]
3743
> [Call the Read API](../how-to/call-read-api.md)
3844
39-
* [OCR overview](../overview-ocr.md)
45+
- [OCR overview](../overview-ocr.md)

0 commit comments

Comments
 (0)