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/ai-services/computer-vision/includes/curl-quickstart.md
+37-30Lines changed: 37 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,73 +8,75 @@ manager: nitinme
8
8
ms.service: cognitive-services
9
9
ms.subservice: computer-vision
10
10
ms.topic: include
11
-
ms.date: 04/19/2021
11
+
ms.date: 08/07/2023
12
12
ms.author: pafarley
13
13
ms.custom: seodec18
14
14
---
15
15
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.
17
17
18
18
> [!NOTE]
19
19
> 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).
20
20
21
21
## Prerequisites
22
22
23
-
* An Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services/)
24
-
* Once you have your Azure subscription, <ahref="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
+
- <ahref="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.
29
27
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.
30
31
31
32
## Read printed and handwritten text
32
33
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).
35
35
36
36
### Call the Read API
37
37
38
38
To create and run the sample, do the following steps:
39
39
40
40
1. Copy the following command into a text editor.
41
41
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.
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.
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.
54
56
55
57
### 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.
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.
73
72
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
+
```
74
76
75
77
### Examine the response
76
78
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:
78
80
79
81
```json
80
82
{
@@ -134,7 +136,12 @@ A successful response is returned in JSON. The sample application parses and dis
134
136
135
137
```
136
138
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.
137
142
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)
Copy file name to clipboardExpand all lines: articles/ai-services/computer-vision/includes/environment-variables.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,20 +3,20 @@ author: PatrickFarley
3
3
ms.service: cognitive-services
4
4
ms.subservice: computer-vision
5
5
ms.topic: include
6
-
ms.date: 02/22/2023
6
+
ms.date: 08/07/2023
7
7
ms.author: pafarley
8
8
---
9
9
10
10
## Create environment variables
11
11
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.
13
13
14
14
[!INCLUDE [find key and endpoint](./find-key.md)]
15
15
16
16
> [!TIP]
17
17
> 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).
18
18
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.
20
20
21
21
1. To set the `VISION_KEY` environment variable, replace `your-key` with one of the keys for your resource.
22
22
2. To set the `VISION_ENDPOINT` environment variable, replace `your-endpoint` with the endpoint for your resource.
Copy file name to clipboardExpand all lines: articles/ai-services/computer-vision/includes/find-key.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,8 @@ manager: nitinme
8
8
ms.service: cognitive-services
9
9
ms.subservice: computer-vision
10
10
ms.topic: include
11
-
ms.date: 03/23/2022
11
+
ms.date: 08/07/2023
12
12
ms.author: pafarley
13
13
---
14
14
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.
Copy file name to clipboardExpand all lines: articles/ai-services/computer-vision/includes/ocr-studio-quickstart.md
+13-7Lines changed: 13 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,25 +9,31 @@ manager: nitinme
9
9
ms.service: cognitive-services
10
10
ms.subservice: computer-vision
11
11
ms.topic: include
12
-
ms.date: 06/13/2022
12
+
ms.date: 08/07/2023
13
13
ms.author: pafarley
14
14
---
15
15
16
16
## Prerequisites
17
17
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/).
19
21
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.
20
24
25
+
For more information, see [Get started using Vision Studio](../overview-vision-studio.md#get-started-using-vision-studio).
21
26
22
27
## Read printed and handwritten text
23
28
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/).
26
31
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.
29
33
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.
30
35
36
+
Below the try-it-out experience are next steps to start using this capability in your own application.
31
37
32
38
## Next steps
33
39
@@ -36,4 +42,4 @@ In this quickstart, you used Vision Studio to access the Read API. Next, learn m
0 commit comments