Skip to content

Commit 13104c9

Browse files
authored
Merge pull request #115032 from v-jaswel/patch-10
[DO NOT MERGE UNTIL BUILD] Update CSharp-print-text.md, curl-print-text.md, go-print-text.md, java-print-text.md, javascript-print-text.md, node-print-text.md, python-domain.md, python-print-text.md, python-hand-text.md
2 parents 57dc3d0 + 03a5a9b commit 13104c9

File tree

8 files changed

+16
-26
lines changed

8 files changed

+16
-26
lines changed

articles/cognitive-services/Computer-vision/QuickStarts/curl-print-text.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ To create and run the sample, do the following steps:
3939
1. Paste the command from the text editor into the command prompt window, and then run the command.
4040

4141
```bash
42-
curl -H "Ocp-Apim-Subscription-Key: <subscriptionKey>" -H "Content-Type: application/json" "https://westcentralus.api.cognitive.microsoft.com/vision/v2.1/ocr?language=unk&detectOrientation=true" -d "{\"url\":\"https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/Atomist_quote_from_Democritus.png/338px-Atomist_quote_from_Democritus.png\"}"
42+
curl -H "Ocp-Apim-Subscription-Key: <subscriptionKey>" -H "Content-Type: application/json" "https://westcentralus.api.cognitive.microsoft.com/vision/v3.0/ocr?language=unk&detectOrientation=true" -d "{\"url\":\"https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/Atomist_quote_from_Democritus.png/338px-Atomist_quote_from_Democritus.png\"}"
4343
```
4444

4545
## Examine the response

articles/cognitive-services/Computer-vision/QuickStarts/go-print-text.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,28 +46,23 @@ import (
4646
"fmt"
4747
"io/ioutil"
4848
"net/http"
49+
"os"
4950
"strings"
5051
"time"
5152
)
5253

5354
func main() {
55+
// Add your Computer Vision subscription key and endpoint to your environment variables.
5456
// Add your Computer Vision subscription key and endpoint to your environment variables.
5557
subscriptionKey := os.Getenv("COMPUTER_VISION_SUBSCRIPTION_KEY")
56-
if (subscriptionKey == "") {
57-
log.Fatal("\n\nSet the COMPUTER_VISION_SUBSCRIPTION_KEY environment variable.\n" +
58-
"**Restart your shell or IDE for changes to take effect.**\n")
59-
6058
endpoint := os.Getenv("COMPUTER_VISION_ENDPOINT")
61-
if ("" == endpoint) {
62-
log.Fatal("\n\nSet the COMPUTER_VISION_ENDPOINT environment variable.\n" +
63-
"**Restart your shell or IDE for changes to take effect.**")
64-
}
65-
const uriBase = endpoint + "vision/v2.1/ocr"
59+
60+
uriBase := endpoint + "vision/v3.0/ocr"
6661
const imageUrl = "https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/" +
6762
"Atomist_quote_from_Democritus.png/338px-Atomist_quote_from_Democritus.png"
6863

69-
const params = "?language=unk&detectOrientation=true"
70-
const uri = uriBase + params
64+
params := "?language=unk&detectOrientation=true"
65+
uri := uriBase + params
7166
const imageUrlEnc = "{\"url\":\"" + imageUrl + "\"}"
7267

7368
reader := strings.NewReader(imageUrlEnc)

articles/cognitive-services/Computer-vision/QuickStarts/java-print-text.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,12 @@ To create and run the sample, do the following steps:
5858

5959
```java
6060
public class Main {
61-
// **********************************************
62-
// *** Update or verify the following values. ***
63-
// **********************************************
6461

6562
// Add your Computer Vision subscription key and endpoint to your environment variables.
66-
// After setting, close and then re-open your command shell or project for the changes to take effect.
67-
String subscriptionKey = System.getenv("COMPUTER_VISION_SUBSCRIPTION_KEY");
68-
String endpoint = ("COMPUTER_VISION_ENDPOINT");
63+
private static String subscriptionKey = System.getenv("COMPUTER_VISION_SUBSCRIPTION_KEY");
64+
private static String endpoint = System.getenv("COMPUTER_VISION_ENDPOINT");
6965

70-
private static final String uriBase = endpoint +
71-
"vision/v2.1/ocr";
66+
private static final String uriBase = endpoint + "vision/v3.0/ocr";
7267

7368
private static final String imageToAnalyze =
7469
"https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/" +

articles/cognitive-services/Computer-vision/QuickStarts/javascript-print-text.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ To create and run the sample, do the following steps:
5656
var subscriptionKey = document.getElementById("subscriptionKey").value;
5757
var endpoint = document.getElementById("endpointUrl").value;
5858
59-
var uriBase = endpoint + "vision/v2.1/ocr";
59+
var uriBase = endpoint + "vision/v3.0/ocr";
6060
6161
// Request parameters.
6262
var params = {
@@ -245,4 +245,4 @@ Next, explore a JavaScript application that uses Computer Vision to perform opti
245245
> [!div class="nextstepaction"]
246246
> [Computer Vision API JavaScript Tutorial](../Tutorials/javascript-tutorial.md)
247247
248-
* To rapidly experiment with the Computer Vision API, try the [Open API testing console](https://westcentralus.dev.cognitive.microsoft.com/docs/services/5adf991815e1060e6355ad44/operations/56f91f2e778daf14a499e1fa/console).
248+
* To rapidly experiment with the Computer Vision API, try the [Open API testing console](https://westcentralus.dev.cognitive.microsoft.com/docs/services/5adf991815e1060e6355ad44/operations/56f91f2e778daf14a499e1fa/console).

articles/cognitive-services/Computer-vision/QuickStarts/node-print-text.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ let subscriptionKey = process.env['COMPUTER_VISION_SUBSCRIPTION_KEY'];
5858
let endpoint = process.env['COMPUTER_VISION_ENDPOINT']
5959
if (!subscriptionKey) { throw new Error('Set your environment variables for your subscription key and endpoint.'); }
6060

61-
var uriBase = endpoint + 'vision/v2.1/ocr';
61+
var uriBase = endpoint + 'vision/v3.0/ocr';
6262

6363
const imageUrl = 'https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/' +
6464
'Atomist_quote_from_Democritus.png/338px-Atomist_quote_from_Democritus.png';

articles/cognitive-services/Computer-vision/QuickStarts/python-domain.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ else:
5858
if 'COMPUTER_VISION_ENDPOINT' in os.environ:
5959
endpoint = os.environ['COMPUTER_VISION_ENDPOINT']
6060

61-
landmark_analyze_url = endpoint + "vision/v2.1/models/landmarks/analyze"
61+
landmark_analyze_url = endpoint + "vision/v3.0/models/landmarks/analyze"
6262

6363
# Set image_url to the URL of an image that you want to analyze.
6464
image_url = "https://upload.wikimedia.org/wikipedia/commons/f/f6/" + \

articles/cognitive-services/Computer-vision/QuickStarts/python-hand-text.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Quickstart: Computer Vision 2.0 and 2.1 - Extract printed and handwritten text - REST, Python"
2+
title: "Quickstart: Computer Vision 2.1 and 3.0 - Extract printed and handwritten text - REST, Python"
33
titleSuffix: "Azure Cognitive Services"
44
description: In this quickstart, you extract printed and handwritten text from an image using the Computer Vision API with Python.
55
services: cognitive-services

articles/cognitive-services/Computer-vision/QuickStarts/python-print-text.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ else:
6262
if 'COMPUTER_VISION_ENDPOINT' in os.environ:
6363
endpoint = os.environ['COMPUTER_VISION_ENDPOINT']
6464

65-
ocr_url = endpoint + "vision/v2.1/ocr"
65+
ocr_url = endpoint + "vision/v3.0/ocr"
6666

6767
# Set image_url to the URL of an image that you want to analyze.
6868
image_url = "https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/" + \

0 commit comments

Comments
 (0)