Skip to content

Commit de38d1b

Browse files
committed
merge setup section; add output section
1 parent 635d954 commit de38d1b

File tree

1 file changed

+58
-34
lines changed
  • articles/cognitive-services/Computer-vision/includes/quickstarts-sdk

1 file changed

+58
-34
lines changed

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

Lines changed: 58 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -29,58 +29,55 @@ Use the OCR client library to read printed and handwritten text from a remote im
2929
* You will need the key and endpoint from the resource you create to connect your application to the Computer Vision service. You'll paste your key and endpoint into the code below later in the quickstart.
3030
* You can use the free pricing tier (`F0`) to try the service, and upgrade later to a paid tier for production.
3131

32-
## Setting up
32+
## Read printed and handwritten text
3333

34-
### Create a new C# application
34+
1. Create a new C# application
3535

36-
#### [Visual Studio IDE](#tab/visual-studio)
36+
#### [Visual Studio IDE](#tab/visual-studio)
3737

38-
Using Visual Studio, create a new .NET Core application.
38+
Using Visual Studio, create a new .NET Core application.
3939

40-
### Install the client library
40+
### Install the client library
4141

42-
Once you've created a new project, install the client library by right-clicking on the project solution in the **Solution Explorer** and selecting **Manage NuGet Packages**. In the package manager that opens select **Browse**, check **Include prerelease**, and search for `Microsoft.Azure.CognitiveServices.Vision.ComputerVision`. Select version `7.0.0`, and then **Install**.
42+
Once you've created a new project, install the client library by right-clicking on the project solution in the **Solution Explorer** and selecting **Manage NuGet Packages**. In the package manager that opens select **Browse**, check **Include prerelease**, and search for `Microsoft.Azure.CognitiveServices.Vision.ComputerVision`. Select version `7.0.0`, and then **Install**.
4343

44-
#### [CLI](#tab/cli)
44+
#### [CLI](#tab/cli)
4545

46-
In a console window (such as cmd, PowerShell, or Bash), use the `dotnet new` command to create a new console app with the name `computer-vision-quickstart`. This command creates a simple "Hello World" C# project with a single source file: *Program.cs*.
46+
In a console window (such as cmd, PowerShell, or Bash), use the `dotnet new` command to create a new console app with the name `computer-vision-quickstart`. This command creates a simple "Hello World" C# project with a single source file: *Program.cs*.
4747

48-
```console
49-
dotnet new console -n computer-vision-quickstart
50-
```
48+
```console
49+
dotnet new console -n computer-vision-quickstart
50+
```
5151

52-
Change your directory to the newly created app folder. You can build the application with:
52+
Change your directory to the newly created app folder. You can build the application with:
5353

54-
```console
55-
dotnet build
56-
```
57-
58-
The build output should contain no warnings or errors.
59-
60-
```console
61-
...
62-
Build succeeded.
63-
0 Warning(s)
64-
0 Error(s)
65-
...
66-
```
54+
```console
55+
dotnet build
56+
```
6757

68-
### Install the client library
58+
The build output should contain no warnings or errors.
6959

70-
Within the application directory, install the Computer Vision client library for .NET with the following command:
60+
```console
61+
...
62+
Build succeeded.
63+
0 Warning(s)
64+
0 Error(s)
65+
...
66+
```
7167

72-
```console
73-
dotnet add package Microsoft.Azure.CognitiveServices.Vision.ComputerVision --version 7.0.0
74-
```
68+
### Install the client library
7569

76-
---
70+
Within the application directory, install the Computer Vision client library for .NET with the following command:
7771

78-
### Find the subscription key and endpoint
72+
```console
73+
dotnet add package Microsoft.Azure.CognitiveServices.Vision.ComputerVision --version 7.0.0
74+
```
7975

80-
[!INCLUDE [find key and endpoint](../find-key.md)]
76+
---
8177

78+
1. Find the subscription key and endpoint.
8279

83-
## Read printed and handwritten text
80+
[!INCLUDE [find key and endpoint](../find-key.md)]
8481

8582
1. From the project directory, open the *Program.cs* file in your preferred editor or IDE. Replace the contents of *Program.cs* with the following code.
8683

@@ -114,6 +111,33 @@ dotnet add package Microsoft.Azure.CognitiveServices.Vision.ComputerVision --ver
114111

115112
---
116113

114+
## Output
115+
116+
```console
117+
Azure Cognitive Services Computer Vision - .NET quickstart example
118+
119+
----------------------------------------------------------
120+
READ FILE FROM URL
121+
122+
Extracting text from URL file printed_text.jpg...
123+
124+
125+
Nutrition Facts Amount Per Serving
126+
Serving size: 1 bar (40g)
127+
Serving Per Package: 4
128+
Total Fat 13g
129+
Saturated Fat 1.5g
130+
Amount Per Serving
131+
Trans Fat 0g
132+
Calories 190
133+
Cholesterol 0mg
134+
ories from Fat 110
135+
Sodium 20mg
136+
nt Daily Values are based on Vitamin A 50%
137+
calorie diet.
138+
```
139+
140+
117141
## Clean up resources
118142

119143
If you want to clean up and remove a Cognitive Services subscription, you can delete the resource or resource group. Deleting the resource group also deletes any other resources associated with it.

0 commit comments

Comments
 (0)