Skip to content

Commit 8fd847b

Browse files
committed
acrolinx
1 parent 415670d commit 8fd847b

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

articles/ai-services/computer-vision/includes/how-to-guides/analyze-image-40-csharp.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.author: pafarley
1212

1313
This guide assumes you've followed the steps mentioned in the [quickstart](/azure/ai-services/computer-vision/quickstarts-sdk/image-analysis-client-library-40) page. This means:
1414

15-
* You have <a href="https://portal.azure.com/#create/Microsoft.CognitiveServicesComputerVision" title="created a Computer Vision resource" target="_blank">created a Computer Vision resource </a> and obtained a key and endpoint URL.
15+
* You have <a href="https://portal.azure.com/#create/Microsoft.CognitiveServicesComputerVision" title="Created a Computer Vision resource" target="_blank">created a Computer Vision resource </a> and obtained a key and endpoint URL.
1616
* You have the appropriate SDK package installed and you have a running [quickstart](/azure/ai-services/computer-vision/quickstarts-sdk/image-analysis-client-library-40) application. You can modify this quickstart application based on code examples here.
1717

1818
## Create and authenticate the client
@@ -24,7 +24,7 @@ To authenticate against the Image Analysis service, you need a Computer Vision k
2424
2525
Start by creating a [ImageAnalysisClient](/dotnet/api/azure.ai.vision.imageanalysis.imageanalysisclient) object. For example:
2626

27-
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/ComputerVision/4-0/image-analysis-how-to/Program.cs?name=snippet_client)]
27+
[!Code-csharp[](~/cognitive-services-quickstart-code/dotnet/ComputerVision/4-0/image-analysis-how-to/Program.cs?name=snippet_client)]
2828

2929

3030
## Select the image to analyze
@@ -35,14 +35,14 @@ You can select an image by providing a publicly accessible image URL, or by pass
3535

3636
Create a [Uri](/dotnet/api/system.uri) object for the image you want to analyze.
3737

38-
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/ComputerVision/4-0/image-analysis-how-to/Program.cs?name=snippet_url)]
38+
[!Code-csharp[](~/cognitive-services-quickstart-code/dotnet/ComputerVision/4-0/image-analysis-how-to/Program.cs?name=snippet_url)]
3939

4040

4141
### Image buffer
4242

4343
Alternatively, you can pass the image data to the SDK through a [BinaryData](/dotnet/api/system.binarydata) object. For example, read from a local image file you want to analyze.
4444

45-
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/ComputerVision/4-0/image-analysis-how-to/Program.cs?name=snippet_file)]
45+
[!Code-csharp[](~/cognitive-services-quickstart-code/dotnet/ComputerVision/4-0/image-analysis-how-to/Program.cs?name=snippet_file)]
4646

4747

4848

@@ -56,7 +56,7 @@ The Analysis 4.0 API gives you access to all of the service's image analysis fea
5656
5757

5858

59-
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/ComputerVision/4-0/image-analysis-how-to/Program.cs?name=snippet_features)]
59+
[!Code-csharp[](~/cognitive-services-quickstart-code/dotnet/ComputerVision/4-0/image-analysis-how-to/Program.cs?name=snippet_features)]
6060

6161
<!--
6262
### Set model name when using a custom model
@@ -72,31 +72,31 @@ To use a custom model, create the [ImageAnalysisOptions](/dotnet/api/azure.ai.vi
7272

7373
## Select analysis options
7474

75-
Use an [ImageAnalysisOptions](/dotnet/api/azure.ai.vision.imageanalysis.imageanalysisoptions) object to specify various options for the Analyze API call.
75+
Use an [ImageAnalysisOptions](/dotnet/api/azure.ai.vision.imageanalysis.imageanalysisoptions) object to specify various options for the Analyze Image API call.
7676

7777
- **Language**: You can specify the language of the returned data. The language is optional, with the default being English. See [Language support](https://aka.ms/cv-languages) for a list of supported language codes and which visual features are supported for each language.
7878
- **Gender neutral captions**: If you're extracting captions or dense captions (using [VisualFeatures.Caption](/dotnet/api/azure.ai.vision.imageanalysis.visualfeatures) or [VisualFeatures.DenseCaptions](/dotnet/api/azure.ai.vision.imageanalysis.visualfeatures)), you can ask for gender neutral captions. Gender neutral captions are optional, with the default being gendered captions. For example, in English, when you select gender neutral captions, terms like **woman** or **man** are replaced with **person**, and **boy** or **girl** are replaced with **child**.
7979
- **Crop aspect ratio**: An aspect ratio is calculated by dividing the target crop width by the height. Supported values are from 0.75 to 1.8 (inclusive). Setting this property is only relevant when [VisualFeatures.SmartCrops](/dotnet/api/azure.ai.vision.imageanalysis.visualfeatures) was selected as part the visual feature list. If you select [VisualFeatures.SmartCrops](/dotnet/api/azure.ai.vision.imageanalysis.visualfeatures) but don't specify aspect ratios, the service returns one crop suggestion with an aspect ratio it sees fit. In this case, the aspect ratio is between 0.5 and 2.0 (inclusive).
8080

8181

82-
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/ComputerVision/4-0/image-analysis-how-to/Program.cs?name=snippet_options)]
82+
[!Code-csharp[](~/cognitive-services-quickstart-code/dotnet/ComputerVision/4-0/image-analysis-how-to/Program.cs?name=snippet_options)]
8383

8484
## Call the Analyze API
8585

8686
This section shows you how to make an analysis call to the service.
8787

88-
Call the [Analyze](/dotnet/api/azure.ai.vision.imageanalysis.imageanalysisclient#methods) method on the [ImageAnalysisClient](/dotnet/api/azure.ai.vision.imageanalysis.imageanalysisclient) object, as shown here. The call is synchronous, and will block until the service returns the results or an error occurred. Alternatively, you can call the non-blocking [AnalyzeAsync](/dotnet/api/azure.ai.vision.imageanalysis.imageanalysisclient#methods) method.
88+
Call the [Analyze](/dotnet/api/azure.ai.vision.imageanalysis.imageanalysisclient#methods) method on the [ImageAnalysisClient](/dotnet/api/azure.ai.vision.imageanalysis.imageanalysisclient) object, as shown here. The call is synchronous, and blocks execution until the service returns the results or an error occurred. Alternatively, you can call the non-blocking [AnalyzeAsync](/dotnet/api/azure.ai.vision.imageanalysis.imageanalysisclient#methods) method.
8989

9090
Use the input objects created in the above sections. To analyze from an image buffer instead of URL, replace `imageURL` in the method call with the `imageData` variable.
9191

92-
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/ComputerVision/4-0/image-analysis-how-to/Program.cs?name=snippet_call)]
92+
[!Code-csharp[](~/cognitive-services-quickstart-code/dotnet/ComputerVision/4-0/image-analysis-how-to/Program.cs?name=snippet_call)]
9393

9494

9595
## Get results from the service
9696

9797
The following code shows you how to parse the results of the various Analyze operations.
9898

99-
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/ComputerVision/4-0/image-analysis-how-to/Program.cs?name=snippet_results)]
99+
[!Code-csharp[](~/cognitive-services-quickstart-code/dotnet/ComputerVision/4-0/image-analysis-how-to/Program.cs?name=snippet_results)]
100100

101101
<!--
102102
### Get results using custom model

articles/ai-services/computer-vision/includes/how-to-guides/analyze-image-40-java.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.author: pafarley
1212

1313
This guide assumes you've followed the steps in the [quickstart](/azure/ai-services/computer-vision/quickstarts-sdk/image-analysis-client-library-40) page. This means:
1414

15-
* You have <a href="https://portal.azure.com/#create/Microsoft.CognitiveServicesComputerVision" title="created a Computer Vision resource" target="_blank">created a Computer Vision resource </a> and obtained a key and endpoint URL.
15+
* You have <a href="https://portal.azure.com/#create/Microsoft.CognitiveServicesComputerVision" title="Created a Computer Vision resource" target="_blank">created a Computer Vision resource </a> and obtained a key and endpoint URL.
1616
* You have the appropriate SDK package installed and you have a running [quickstart](/azure/ai-services/computer-vision/quickstarts-sdk/image-analysis-client-library-40) application. You can modify this quickstart application based on code examples here.
1717

1818
## Create and authenticate the client
@@ -24,7 +24,7 @@ To authenticate with the Image Analysis service, you need a Computer Vision key
2424
2525
Start by creating an [ImageAnalysisClient](/java/api/com.azure.ai.vision.imageanalysis.imageanalysisclient) object. For example:
2626

27-
[!code-java[](~/cognitive-services-quickstart-code/java/ComputerVision/4-0/ImageAnalysisHowTo.java?name=snippet_client)]
27+
[!Code-java[](~/cognitive-services-quickstart-code/java/ComputerVision/4-0/ImageAnalysisHowTo.java?name=snippet_client)]
2828

2929

3030
## Select the image to analyze
@@ -35,13 +35,13 @@ You can select an image by providing a publicly accessible image URL, or by read
3535

3636
Create an `imageUrl` string to hold the publicly accessible URL of the image you want to analyze.
3737

38-
[!code-java[](~/cognitive-services-quickstart-code/java/ComputerVision/4-0/ImageAnalysisHowTo.java?name=snippet_url)]
38+
[!Code-java[](~/cognitive-services-quickstart-code/java/ComputerVision/4-0/ImageAnalysisHowTo.java?name=snippet_url)]
3939

4040
### Image buffer
4141

4242
Alternatively, you can pass in the image as memory buffer using a [BinaryData](/java/api/com.azure.core.util.binarydata) object. For example, read from a local image file you want to analyze.
4343

44-
[!code-java[](~/cognitive-services-quickstart-code/java/ComputerVision/4-0/ImageAnalysisHowTo.java?name=snippet_file)]
44+
[!Code-java[](~/cognitive-services-quickstart-code/java/ComputerVision/4-0/ImageAnalysisHowTo.java?name=snippet_file)]
4545

4646
## Select visual features
4747

@@ -50,7 +50,7 @@ The Analysis 4.0 API gives you access to all of the service's image analysis fea
5050
> [!IMPORTANT]
5151
> The visual features [Captions](/java/api/com.azure.ai.vision.imageanalysis.models.visualfeatures#com-azure-ai-vision-imageanalysis-models-visualfeatures-caption) and [DenseCaptions](/java/api/com.azure.ai.vision.imageanalysis.models.visualfeatures#com-azure-ai-vision-imageanalysis-models-visualfeatures-dense-captions) are only supported in certain Azure regions. See [Region availability](./../../overview-image-analysis.md#region-availability).
5252
53-
[!code-java[](~/cognitive-services-quickstart-code/java/ComputerVision/4-0/ImageAnalysisHowTo.java?name=snippet_features)]
53+
[!Code-java[](~/cognitive-services-quickstart-code/java/ComputerVision/4-0/ImageAnalysisHowTo.java?name=snippet_features)]
5454

5555
<!--
5656
### Set model name when using a custom model
@@ -70,17 +70,17 @@ Use an [ImageAnalysisOptions](/java/api/com.azure.ai.vision.imageanalysis.models
7070
- **Gender neutral captions**: If you're extracting captions or dense captions (using [VisualFeatures.CAPTION](/java/api/com.azure.ai.vision.imageanalysis.models.visualfeatures#com-azure-ai-vision-imageanalysis-models-visualfeatures-caption) or [VisualFeatures.DENSE_CAPTIONS](/java/api/com.azure.ai.vision.imageanalysis.models.visualfeatures#com-azure-ai-vision-imageanalysis-models-visualfeatures-dense-captions)), you can ask for gender neutral captions. Gender neutral captions are optional, with the default being gendered captions. For example, in English, when you select gender neutral captions, terms like **woman** or **man** are replaced with **person**, and **boy** or **girl** are replaced with **child**.
7171
- **Crop aspect ratio**: An aspect ratio is calculated by dividing the target crop width by the height. Supported values are from 0.75 to 1.8 (inclusive). Setting this property is only relevant when [VisualFeatures.SMART_CROPS](/java/api/com.azure.ai.vision.imageanalysis.models.visualfeatures#com-azure-ai-vision-imageanalysis-models-visualfeatures-smart-crops) was selected as part the visual feature list. If you select [VisualFeatures.SMART_CROPS](/java/api/com.azure.ai.vision.imageanalysis.models.visualfeatures#com-azure-ai-vision-imageanalysis-models-visualfeatures-smart-crops) but don't specify aspect ratios, the service returns one crop suggestion with an aspect ratio it sees fit. In this case, the aspect ratio is between 0.5 and 2.0 (inclusive).
7272

73-
[!code-java[](~/cognitive-services-quickstart-code/java/ComputerVision/4-0/ImageAnalysisHowTo.java?name=snippet_options)]
73+
[!Code-java[](~/cognitive-services-quickstart-code/java/ComputerVision/4-0/ImageAnalysisHowTo.java?name=snippet_options)]
7474

7575
## Call the analyzeFromUrl method
7676

7777
This section shows you how to make an analysis call to the service.
7878

79-
Call the [analyzeFromUrl](/java/api/com.azure.ai.vision.imageanalysis.imageanalysisclient#method-summary) method on the [ImageAnalysisClient](/java/api/com.azure.ai.vision.imageanalysis.imageanalysisclient) object, as shown here. The call is synchronous, and will block until the service returns the results or an error occurred. Alternatively, you can use a [ImageAnalysisAsyncClient](/java/api/com.azure.ai.vision.imageanalysis.imageanalysisasyncclient) object instead, and call its [analyzeFromUrl](/java/api/com.azure.ai.vision.imageanalysis.imageanalysisasyncclient#method-summary) method which is non-blocking.
79+
Call the [analyzeFromUrl](/java/api/com.azure.ai.vision.imageanalysis.imageanalysisclient#method-summary) method on the [ImageAnalysisClient](/java/api/com.azure.ai.vision.imageanalysis.imageanalysisclient) object, as shown here. The call is synchronous, and will block until the service returns the results or an error occurred. Alternatively, you can use a [ImageAnalysisAsyncClient](/java/api/com.azure.ai.vision.imageanalysis.imageanalysisasyncclient) object instead, and call its [analyzeFromUrl](/java/api/com.azure.ai.vision.imageanalysis.imageanalysisasyncclient#method-summary) method, which is non-blocking.
8080

8181
To analyze from an image buffer instead of URL, call the [analyze](/java/api/com.azure.ai.vision.imageanalysis.imageanalysisclient#method-summary) method instead, and pass in the `imageData` as the first argument.
8282

83-
[!code-java[](~/cognitive-services-quickstart-code/java/ComputerVision/4-0/ImageAnalysisHowTo.java?name=snippet_call)]
83+
[!Code-java[](~/cognitive-services-quickstart-code/java/ComputerVision/4-0/ImageAnalysisHowTo.java?name=snippet_call)]
8484

8585
<!--
8686
### Get results using custom model
@@ -97,7 +97,7 @@ The code is similar to the standard model case. The only difference is that resu
9797

9898
The following code shows you how to parse the results from the **analyzeFromUrl** and **analyze** operations.
9999

100-
[!code-java[](~/cognitive-services-quickstart-code/java/ComputerVision/4-0/ImageAnalysisHowTo.java?name=snippet_results)]
100+
[!Code-java[](~/cognitive-services-quickstart-code/java/ComputerVision/4-0/ImageAnalysisHowTo.java?name=snippet_results)]
101101

102102
## Troubleshooting
103103

@@ -171,7 +171,7 @@ ImageAnalysisClient client = new ImageAnalysisClientBuilder()
171171

172172
The enum [HttpLogDetailLevel](/java/api/com.azure.core.http.policy.httplogdetaillevel) defines the supported logging levels.
173173

174-
By default, when logging, certain HTTP header and query parameter values are redacted. It is possible to override this default by specifying which headers and query parameters are safe to log:
174+
By default, when logging, certain HTTP header and query parameter values are redacted. It's possible to override this default by specifying which headers and query parameters are safe to log:
175175

176176
```java
177177
ImageAnalysisClient client = new ImageAnalysisClientBuilder()

articles/ai-services/computer-vision/includes/how-to-guides/analyze-image-40-js.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.author: pafarley
1212

1313
This guide assumes you have followed the steps mentioned in the [quickstart](/azure/ai-services/computer-vision/quickstarts-sdk/image-analysis-client-library-40). This means:
1414

15-
* You have <a href="https://portal.azure.com/#create/Microsoft.CognitiveServicesComputerVision" title="created a Computer Vision resource" target="_blank">created a Computer Vision resource </a> and obtained a key and endpoint URL.
15+
* You have <a href="https://portal.azure.com/#create/Microsoft.CognitiveServicesComputerVision" title="Created a Computer Vision resource" target="_blank">created a Computer Vision resource </a> and obtained a key and endpoint URL.
1616
* You have the appropriate SDK package installed and you have a running [quickstart](/azure/ai-services/computer-vision/quickstarts-sdk/image-analysis-client-library-40) application. You can modify this quickstart application based on the code examples here.
1717

1818
## Create and authenticate the client
@@ -24,7 +24,7 @@ To authenticate against the Image Analysis service, you need a Computer Vision k
2424
2525
Start by creating a **ImageAnalysisClient** object. For example:
2626

27-
[!code-javascript[](~/cognitive-services-quickstart-code/javascript/ComputerVision/4-0/how-to.js?name=snippet_client)]
27+
[!Code-javascript[](~/cognitive-services-quickstart-code/javascript/ComputerVision/4-0/how-to.js?name=snippet_client)]
2828

2929
## Select the image to analyze
3030

@@ -34,13 +34,13 @@ You can select an image by providing a publicly accessible image URL, or by read
3434

3535
You can use the following sample image URL.
3636

37-
[!code-javascript[](~/cognitive-services-quickstart-code/javascript/ComputerVision/4-0/how-to.js?name=snippet_url)]
37+
[!Code-javascript[](~/cognitive-services-quickstart-code/javascript/ComputerVision/4-0/how-to.js?name=snippet_url)]
3838

3939
### Image buffer
4040

4141
Alternatively, you can pass in the image as a data array. For example, read from a local image file you want to analyze.
4242

43-
[!code-javascript[](~/cognitive-services-quickstart-code/javascript/ComputerVision/4-0/how-to.js?name=snippet_file)]
43+
[!Code-javascript[](~/cognitive-services-quickstart-code/javascript/ComputerVision/4-0/how-to.js?name=snippet_file)]
4444

4545

4646
## Select visual features
@@ -50,13 +50,13 @@ The Analysis 4.0 API gives you access to all of the service's image analysis fea
5050
> [!IMPORTANT]
5151
> The visual features [Captions](/java/api/com.azure.ai.vision.imageanalysis.models.visualfeatures#com-azure-ai-vision-imageanalysis-models-visualfeatures-caption) and [DenseCaptions](/java/api/com.azure.ai.vision.imageanalysis.models.visualfeatures#com-azure-ai-vision-imageanalysis-models-visualfeatures-dense-captions) are only supported in certain Azure regions. See .
5252
53-
[!code-javascript[](~/cognitive-services-quickstart-code/javascript/ComputerVision/4-0/how-to.js?name=snippet_features)]
53+
[!Code-javascript[](~/cognitive-services-quickstart-code/javascript/ComputerVision/4-0/how-to.js?name=snippet_features)]
5454

5555
## Call the Analyze API with options
5656

57-
The following code calls the Analyze API with the features you selected above and additional options, defined below. To analyze from an image buffer instead of URL, replace `imageURL` in the method call with `imageData`.
57+
The following code calls the Analyze Image API with the features you selected above and other options, defined next. To analyze from an image buffer instead of URL, replace `imageURL` in the method call with `imageData`.
5858

59-
[!code-javascript[](~/cognitive-services-quickstart-code/javascript/ComputerVision/4-0/how-to.js?name=snippet_call)]
59+
[!Code-javascript[](~/cognitive-services-quickstart-code/javascript/ComputerVision/4-0/how-to.js?name=snippet_call)]
6060

6161

6262
### Select smart cropping aspect ratios
@@ -75,7 +75,7 @@ You can specify the language of the returned data. The language is optional, wit
7575

7676
The following code shows you how to parse the results of the various **analyze** operations.
7777

78-
[!code-javascript[](~/cognitive-services-quickstart-code/javascript/ComputerVision/4-0/how-to.js?name=snippet_results)]
78+
[!Code-javascript[](~/cognitive-services-quickstart-code/javascript/ComputerVision/4-0/how-to.js?name=snippet_results)]
7979

8080

8181
## Troubleshooting

0 commit comments

Comments
 (0)