Skip to content

Commit 92f7187

Browse files
authored
Merge pull request #190382 from sanjeev3/main
Updated Python and JS QuickStarts with model version example
2 parents d1b45ca + 9eb76ff commit 92f7187

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

articles/cognitive-services/Computer-vision/includes/quickstarts-sdk/node-sdk.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ Define the `readTextFromURL` function. This calls the **read** method on the cl
133133

134134
[!code-javascript[](~/cognitive-services-quickstart-code/javascript/ComputerVision/ComputerVisionQuickstart.js?name=snippet_read_helper)]
135135

136+
As an optional step, see [How to specify the model version](../../Vision-API-How-to-Topics/call-read-api.md#determine-how-to-process-the-data-optional). The most recent model includes any enhancements to the previous GA and preview models. For example, to use the model version `2022-01-30-preview`, edit the `read` statement as shown:
137+
138+
```JS
139+
let result = await client.read(url,{modelVersion:"2022-01-30-preview"});
140+
```
141+
136142
Then, define the helper function `printRecText`, which prints the results of the Read operations to the console.
137143

138144
[!code-javascript[](~/cognitive-services-quickstart-code/javascript/ComputerVision/ComputerVisionQuickstart.js?name=snippet_read_print)]

articles/cognitive-services/Computer-vision/includes/quickstarts-sdk/python-sdk.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ First, use the following code to call the **read** method for the given image. T
9898

9999
[!code-python[](~/cognitive-services-quickstart-code/python/ComputerVision/ComputerVisionQuickstart.py?name=snippet_read_call)]
100100

101+
As an optional step, see [How to specify the model version](../../Vision-API-How-to-Topics/call-read-api.md#determine-how-to-process-the-data-optional). The most recent model includes any enhancements to the previous GA and preview models. For example, to use the model version `2022-01-30-preview`, edit the `read` statement as shown:
102+
103+
```python
104+
# Call API with URL and raw response (allows you to get the operation location)
105+
read_response = computervision_client.read(read_image_url, raw=True, model_version="2022-01-30-preview")
106+
```
107+
101108
> [!TIP]
102109
> You can also read text from a local image. See the [ComputerVisionClientOperationsMixin](/python/api/azure-cognitiveservices-vision-computervision/azure.cognitiveservices.vision.computervision.operations.computervisionclientoperationsmixin) methods, such as **read_in_stream**. Or, see the sample code on [GitHub](https://github.com/Azure-Samples/cognitive-services-quickstart-code/blob/master/python/ComputerVision/ComputerVisionQuickstart.py) for scenarios involving local images.
103110

0 commit comments

Comments
 (0)