Skip to content

Commit 09d8e0a

Browse files
authored
Merge pull request #190333 from sanjeev3/main
Update csharp-sdk.md to show model-version use
2 parents f4c5438 + a7e9d19 commit 09d8e0a

File tree

1 file changed

+8
-1
lines changed
  • articles/cognitive-services/Computer-vision/includes/quickstarts-sdk

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ In a new method in the **Program** class, instantiate a client with your endpoin
116116

117117
## Read printed and handwritten text
118118

119-
The OCR service can read visible text in an image and convert it to a character stream. For more information on text recognition, see the [Optical character recognition (OCR)](../../overview-ocr.md) overview. The code in this section uses the latest [Computer Vision SDK release for Read 3.0](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Vision.ComputerVision/) and defines a method, `BatchReadFileUrl`, which uses the client object to detect and extract text in the image.
119+
The OCR service can read visible text in an image and convert it to a character stream. For more information on text recognition, see the [Optical character recognition (OCR)](../../overview-ocr.md) overview. The code in this section uses the [Computer Vision SDK release](https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Vision.ComputerVision/) and defines a method, `ReadFileUrl`, which uses the client object to detect and extract text in the image.
120120

121121
> [!TIP]
122122
> You can also extract text from a local image. See the [ComputerVisionClient](/dotnet/api/microsoft.azure.cognitiveservices.vision.computervision.computervisionclient) methods, such as **ReadInStreamAsync**. Or, see the sample code on [GitHub](https://github.com/Azure-Samples/cognitive-services-quickstart-code/blob/master/dotnet/ComputerVision/ComputerVisionQuickstart.cs#162) for scenarios involving local images.
@@ -133,6 +133,13 @@ Define the new method for reading text. Add the code below, which calls the **Re
133133

134134
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/ComputerVision/ComputerVisionQuickstart.cs?name=snippet_readfileurl_1)]
135135

136+
As an optional step, to specify a model version, 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` parameter, edit the ReadAsync call as shown:
137+
138+
```csharp
139+
// Read text from URL with a specific model version
140+
var textHeaders = await client.ReadAsync(urlFile,null,null,"2021-09-30-preview");
141+
```
142+
136143
### Get Read results
137144

138145
Next, get the operation ID returned from the **ReadAsync** call, and use it to query the service for operation results. The following code checks the operation until the results are returned. It then prints the extracted text data to the console.

0 commit comments

Comments
 (0)