Skip to content

Commit 9a4c06d

Browse files
authored
Merge pull request #194976 from PatrickFarley/comvis-updates
[cog svcs] Comvis updates
2 parents f05992e + 31bd121 commit 9a4c06d

File tree

11 files changed

+354
-552
lines changed

11 files changed

+354
-552
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36613,6 +36613,11 @@
3661336613
"redirect_url": "/azure/cognitive-services/Computer-vision/quickstarts-sdk/csharp-sdk",
3661436614
"redirect_document_id": false
3661536615
},
36616+
{
36617+
"source_path_from_root": "/articles/cognitive-services/Computer-vision/Tutorials/CSharpTutorial.md",
36618+
"redirect_url": "/azure/cognitive-services/Computer-vision/overview-image-analysis",
36619+
"redirect_document_id": false
36620+
},
3661636621
{
3661736622
"source_path_from_root": "/articles/cognitive-services/Content-Moderator/Review-Tool-User-Guide/Upload-Images.md",
3661836623
"redirect_url": "/azure/cognitive-services/content-moderator",

articles/cognitive-services/Computer-vision/Tutorials/CSharpTutorial.md

Lines changed: 0 additions & 313 deletions
This file was deleted.

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.

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

0 commit comments

Comments
 (0)