Skip to content

Commit 31bd121

Browse files
committed
add output sections; move setting up sec into main list
1 parent de38d1b commit 31bd121

File tree

8 files changed

+291
-201
lines changed

8 files changed

+291
-201
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Use the OCR client library to read printed and handwritten text from a remote im
3131

3232
## Read printed and handwritten text
3333

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

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

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

Lines changed: 58 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -31,57 +31,55 @@ Use the Image Analysis client library for C# to analyze an image for content tag
3131
* 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.
3232
* You can use the free pricing tier (`F0`) to try the service, and upgrade later to a paid tier for production.
3333

34-
## Setting up
35-
36-
### Create a new C# application
34+
## Analyze image
3735

38-
#### [Visual Studio IDE](#tab/visual-studio)
36+
1. Create a new C# application.
3937

40-
Using Visual Studio, create a new .NET Core application.
38+
#### [Visual Studio IDE](#tab/visual-studio)
4139

42-
### Install the client library
40+
Using Visual Studio, create a new .NET Core application.
4341

44-
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+
### Install the client library
4543

46-
#### [CLI](#tab/cli)
44+
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**.
4745

48-
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+
#### [CLI](#tab/cli)
4947

50-
```console
51-
dotnet new console -n computer-vision-quickstart
52-
```
48+
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*.
5349

54-
Change your directory to the newly created app folder. You can build the application with:
50+
```console
51+
dotnet new console -n computer-vision-quickstart
52+
```
5553

56-
```console
57-
dotnet build
58-
```
54+
Change your directory to the newly created app folder. You can build the application with:
5955

60-
The build output should contain no warnings or errors.
56+
```console
57+
dotnet build
58+
```
6159

62-
```console
63-
...
64-
Build succeeded.
65-
0 Warning(s)
66-
0 Error(s)
67-
...
68-
```
60+
The build output should contain no warnings or errors.
6961

70-
### Install the client library
62+
```console
63+
...
64+
Build succeeded.
65+
0 Warning(s)
66+
0 Error(s)
67+
...
68+
```
7169

72-
Within the application directory, install the Computer Vision client library for .NET with the following command:
70+
### Install the client library
7371

74-
```console
75-
dotnet add package Microsoft.Azure.CognitiveServices.Vision.ComputerVision --version 7.0.0
76-
```
72+
Within the application directory, install the Computer Vision client library for .NET with the following command:
7773

78-
---
74+
```console
75+
dotnet add package Microsoft.Azure.CognitiveServices.Vision.ComputerVision --version 7.0.0
76+
```
7977

80-
### Find the subscription key and endpoint
78+
---
8179

82-
[!INCLUDE [find key and endpoint](../find-key.md)]
80+
1. Find the subscription key and endpoint.
8381

84-
## Analyze image
82+
[!INCLUDE [find key and endpoint](../find-key.md)]
8583

8684
1. From the project directory, open the *Program.cs* file in your preferred editor or IDE. Paste in the following code:
8785

@@ -108,6 +106,33 @@ dotnet add package Microsoft.Azure.CognitiveServices.Vision.ComputerVision --ver
108106

109107
---
110108

109+
## Output
110+
111+
```console
112+
----------------------------------------------------------
113+
ANALYZE IMAGE - URL
114+
115+
Analyzing the image sample16.png...
116+
117+
Tags:
118+
grass 0.9957543611526489
119+
dog 0.9939157962799072
120+
mammal 0.9928356409072876
121+
animal 0.9918001890182495
122+
dog breed 0.9890419244766235
123+
pet 0.974603533744812
124+
outdoor 0.969241738319397
125+
companion dog 0.906731367111206
126+
small greek domestic dog 0.8965123891830444
127+
golden retriever 0.8877675533294678
128+
labrador retriever 0.8746421337127686
129+
puppy 0.872604250907898
130+
ancient dog breeds 0.8508287668228149
131+
field 0.8017748594284058
132+
retriever 0.6837497353553772
133+
brown 0.6581960916519165
134+
```
135+
111136
## Clean up resources
112137

113138
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.

articles/cognitive-services/Computer-vision/includes/quickstarts-sdk/image-analysis-java-sdk.md

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -33,61 +33,59 @@ Use the Image Analysis client library to analyze a remote image for tags, text d
3333
* 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.
3434
* You can use the free pricing tier (`F0`) to try the service, and upgrade later to a paid tier for production.
3535

36-
## Setting up
37-
38-
### Create a new Gradle project
39-
40-
In a console window (such as cmd, PowerShell, or Bash), create a new directory for your app, and navigate to it.
41-
42-
```console
43-
mkdir myapp && cd myapp
44-
```
45-
46-
Run the `gradle init` command from your working directory. This command will create essential build files for Gradle, including *build.gradle.kts*, which is used at runtime to create and configure your application.
36+
## Analyze image
4737

48-
```console
49-
gradle init --type basic
50-
```
38+
1. Create a new Gradle project.
5139

52-
When prompted to choose a **DSL**, select **Kotlin**.
40+
In a console window (such as cmd, PowerShell, or Bash), create a new directory for your app, and navigate to it.
41+
42+
```console
43+
mkdir myapp && cd myapp
44+
```
45+
46+
Run the `gradle init` command from your working directory. This command will create essential build files for Gradle, including *build.gradle.kts*, which is used at runtime to create and configure your application.
47+
48+
```console
49+
gradle init --type basic
50+
```
5351

54-
### Install the client library
52+
When prompted to choose a **DSL**, select **Kotlin**.
5553

56-
This quickstart uses the Gradle dependency manager. You can find the client library and information for other dependency managers on the [Maven Central Repository](https://search.maven.org/artifact/com.microsoft.azure.cognitiveservices/azure-cognitiveservices-computervision).
54+
1. Install the client library.
5755

58-
Locate *build.gradle.kts* and open it with your preferred IDE or text editor. Then copy in the following build configuration. This configuration defines the project as a Java application whose entry point is the class **ImageAnalysisQuickstart**. It imports the Computer Vision library.
56+
This quickstart uses the Gradle dependency manager. You can find the client library and information for other dependency managers on the [Maven Central Repository](https://search.maven.org/artifact/com.microsoft.azure.cognitiveservices/azure-cognitiveservices-computervision).
5957

60-
```kotlin
61-
plugins {
62-
java
63-
application
64-
}
65-
application {
66-
mainClass.set("ImageAnalysisQuickstart")
67-
}
68-
repositories {
69-
mavenCentral()
70-
}
71-
dependencies {
72-
implementation(group = "com.microsoft.azure.cognitiveservices", name = "azure-cognitiveservices-computervision", version = "1.0.6-beta")
73-
}
74-
```
58+
Locate *build.gradle.kts* and open it with your preferred IDE or text editor. Then copy in the following build configuration. This configuration defines the project as a Java application whose entry point is the class **ImageAnalysisQuickstart**. It imports the Computer Vision library.
7559

76-
### Create a Java file
60+
```kotlin
61+
plugins {
62+
java
63+
application
64+
}
65+
application {
66+
mainClass.set("ImageAnalysisQuickstart")
67+
}
68+
repositories {
69+
mavenCentral()
70+
}
71+
dependencies {
72+
implementation(group = "com.microsoft.azure.cognitiveservices", name = "azure-cognitiveservices-computervision", version = "1.0.6-beta")
73+
}
74+
```
7775

78-
From your working directory, run the following command to create a project source folder:
76+
1. Create a Java file.
7977

80-
```console
81-
mkdir -p src/main/java
82-
```
78+
From your working directory, run the following command to create a project source folder:
8379

84-
Navigate to the new folder and create a file called *ImageAnalysisQuickstart.java*.
80+
```console
81+
mkdir -p src/main/java
82+
```
8583

86-
### Find the subscription key and endpoint
84+
Navigate to the new folder and create a file called *ImageAnalysisQuickstart.java*.
8785

88-
[!INCLUDE [find key and endpoint](../find-key.md)]
86+
1. Find the subscription key and endpoint.
8987

90-
## Analyze image
88+
[!INCLUDE [find key and endpoint](../find-key.md)]
9189

9290
1. Open *ImageAnalysisQuickstart.java* in your preferred editor or IDE and paste in the following code.
9391

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

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -33,45 +33,43 @@ Use the Image Analysis client library for JavaScript to analyze a remote image f
3333
* 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.
3434
* You can use the free pricing tier (`F0`) to try the service, and upgrade later to a paid tier for production.
3535

36-
## Setting up
36+
## Analyze image
3737

38-
### Create a new Node.js application
38+
1. Create a new Node.js application
3939

40-
In a console window (such as cmd, PowerShell, or Bash), create a new directory for your app, and navigate to it.
40+
In a console window (such as cmd, PowerShell, or Bash), create a new directory for your app, and navigate to it.
4141

42-
```console
43-
mkdir myapp && cd myapp
44-
```
42+
```console
43+
mkdir myapp && cd myapp
44+
```
4545

46-
Run the `npm init` command to create a node application with a `package.json` file.
46+
Run the `npm init` command to create a node application with a `package.json` file.
4747

48-
```console
49-
npm init
50-
```
48+
```console
49+
npm init
50+
```
5151

52-
### Install the client library
52+
### Install the client library
5353

54-
Install the `ms-rest-azure` and `@azure/cognitiveservices-computervision` NPM package:
54+
Install the `ms-rest-azure` and `@azure/cognitiveservices-computervision` NPM package:
5555

56-
```console
57-
npm install @azure/cognitiveservices-computervision
58-
```
56+
```console
57+
npm install @azure/cognitiveservices-computervision
58+
```
5959

60-
Also install the async module:
60+
Also install the async module:
6161

62-
```console
63-
npm install async
64-
```
62+
```console
63+
npm install async
64+
```
6565

66-
Your app's `package.json` file will be updated with the dependencies.
66+
Your app's `package.json` file will be updated with the dependencies.
6767

68-
Create a new file, *index.js*.
68+
Create a new file, *index.js*.
6969

70-
### Find the subscription key and endpoint
70+
1. Find the subscription key and endpoint.
7171

72-
[!INCLUDE [find key and endpoint](../find-key.md)]
73-
74-
## Analyze image
72+
[!INCLUDE [find key and endpoint](../find-key.md)]
7573

7674
1. Open *index.js* in a text editor and paste in the following code.
7775

@@ -89,6 +87,19 @@ Create a new file, *index.js*.
8987
node index.js
9088
```
9189

90+
## Output
91+
92+
```console
93+
-------------------------------------------------
94+
DETECT TAGS
95+
96+
Analyzing tags in image... sample16.png
97+
Tags: grass (1.00), dog (0.99), mammal (0.99), animal (0.99), dog breed (0.99), pet (0.97), outdoor (0.97), companion dog (0.91), small greek domestic dog (0.90), golden retriever (0.89), labrador retriever (0.87), puppy (0.87), ancient dog breeds (0.85), field (0.80), retriever (0.68), brown (0.66)
98+
99+
-------------------------------------------------
100+
End of quickstart.
101+
```
102+
92103
## Clean up resources
93104

94105
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.

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

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,29 @@ Use the Image Analysis client library for Python to analyze a remote image for c
3333
* 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.
3434
* You can use the free pricing tier (`F0`) to try the service, and upgrade later to a paid tier for production.
3535

36-
## Setting up
36+
## Analyze image
3737

38-
### Install the client library
38+
1. Install the client library.
3939

40-
You can install the client library with:
40+
You can install the client library with:
4141

42-
```console
43-
pip install --upgrade azure-cognitiveservices-vision-computervision
44-
```
42+
```console
43+
pip install --upgrade azure-cognitiveservices-vision-computervision
44+
```
4545

46-
Also install the Pillow library.
46+
Also install the Pillow library.
4747

48-
```console
49-
pip install pillow
50-
```
48+
```console
49+
pip install pillow
50+
```
5151

52-
### Create a new Python application
52+
1. Create a new Python application.
5353

54-
Create a new Python file—*quickstart-file.py*, for example.
54+
Create a new Python file—*quickstart-file.py*, for example.
5555

56-
### Find the subscription key and endpoint
56+
1. Find the subscription key and endpoint.
5757

58-
[!INCLUDE [find key and endpoint](../find-key.md)]
59-
60-
## Analyze image
58+
[!INCLUDE [find key and endpoint](../find-key.md)]
6159

6260
1. Open *quickstart-file.py* in a text editor or IDE and paste in the following code.
6361

@@ -74,6 +72,30 @@ Create a new Python file—*quickstart-file.py*, for example.
7472
python quickstart-file.py
7573
```
7674

75+
## Output
76+
77+
```console
78+
===== Tag an image - remote =====
79+
Tags in the remote image:
80+
'outdoor' with confidence 99.00%
81+
'building' with confidence 98.81%
82+
'sky' with confidence 98.21%
83+
'stadium' with confidence 98.17%
84+
'ancient rome' with confidence 96.16%
85+
'ruins' with confidence 95.04%
86+
'amphitheatre' with confidence 93.99%
87+
'ancient roman architecture' with confidence 92.65%
88+
'historic site' with confidence 89.55%
89+
'ancient history' with confidence 89.54%
90+
'history' with confidence 86.72%
91+
'archaeological site' with confidence 84.41%
92+
'travel' with confidence 65.85%
93+
'large' with confidence 61.02%
94+
'city' with confidence 56.57%
95+
96+
End of Computer Vision quickstart.
97+
```
98+
7799
## Clean up resources
78100

79101
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)