Skip to content

Commit 7b9b631

Browse files
committed
Fixes
1 parent 7c4e8c9 commit 7b9b631

File tree

3 files changed

+50
-49
lines changed

3 files changed

+50
-49
lines changed

articles/ai-services/computer-vision/how-to/background-removal.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,18 +139,17 @@ Create a new [ImageAnalysisOptions](/python/api/azure-ai-vision/azure.ai.vision.
139139

140140
[!code-python[](~/azure-ai-vision-sdk/docs/learn.microsoft.com/python/image-analysis/segmentation/main.py?name=segmentation_mode)]
141141

142-
### [C++](#tab/cpp)
143-
144-
Create a new [ImageAnalysisOptions](/cpp/cognitive-services/vision/imageanalysis-imageanalysisoptions) object and call the [SetSegmentationMode](/cpp/cognitive-services/vision/imageanalysis-imageanalysisoptions#setsegmentationmode) method. You must call this method if you want to do segmentation. See [ImageSegmentationMode](/cpp/cognitive-services/vision/azure-ai-vision-imageanalysis-namespace#enum-imagesegmentationmode) for supported values.
145-
146-
[!code-cpp[](~/azure-ai-vision-sdk/docs/learn.microsoft.com/cpp/image-analysis/segmentation/segmentation.cpp?name=segmentation_mode)]
147-
148142
### [Java](#tab/java)
149143

150144
Create a new [ImageAnalysisOptions](/java/api/com.azure.ai.vision.imageanalysis.imageanalysisoptions) object and call the [setSegmentationMode](/java/api/com.azure.ai.vision.imageanalysis.imageanalysisoptions#com-azure-ai-vision-imageanalysis-imageanalysisoptions-setsegmentationmode()) method. You must call this method if you want to do segmentation. See [ImageSegmentationMode](/java/api/com.azure.ai.vision.imageanalysis.imagesegmentationmode) for supported values.
151145

152146
[!code-java[](~/azure-ai-vision-sdk/docs/learn.microsoft.com/java/image-analysis/segmentation/ImageAnalysis.java?name=segmentation_mode)]
153147

148+
### [C++](#tab/cpp)
149+
150+
Create a new [ImageAnalysisOptions](/cpp/cognitive-services/vision/imageanalysis-imageanalysisoptions) object and call the [SetSegmentationMode](/cpp/cognitive-services/vision/imageanalysis-imageanalysisoptions#setsegmentationmode) method. You must call this method if you want to do segmentation. See [ImageSegmentationMode](/cpp/cognitive-services/vision/azure-ai-vision-imageanalysis-namespace#enum-imagesegmentationmode) for supported values.
151+
152+
[!code-cpp[](~/azure-ai-vision-sdk/docs/learn.microsoft.com/cpp/image-analysis/segmentation/segmentation.cpp?name=segmentation_mode)]
154153

155154
### [REST](#tab/rest)
156155

articles/ai-services/computer-vision/includes/image-analysis-error-codes-40.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@ Make sure the [ImageAnalysisOptions](/python/api/azure-ai-vision/azure.ai.vision
2828

2929
To help resolve issues, look at the [Image Analysis Samples](https://github.com/Azure-Samples/azure-ai-vision-sdk) repository and run the closest sample to your scenario. Search the [GitHub issues](https://github.com/Azure-Samples/azure-ai-vision-sdk/issues) to see if your issue was already address. If not, create a new.
3030

31+
# [Java](#tab/java)
32+
33+
The sample code for getting analysis results shows how to handle errors and get the [ImageAnalysisErrorDetails](/java/api/com.azure.ai.vision.imageanalysis.imageanalysiserrordetails) object that contains the error information. The error information includes:
34+
35+
* Error reason. See enum [ImageAnalysisErrorReason](/java/api/com.azure.ai.vision.imageanalysis.imageanalysiserrorreason).
36+
* Error code and error message. Select the **REST API** tab to see a list of some common error codes and messages.
37+
38+
In addition to those errors, the SDK has a few other error messages, including:
39+
* `Missing Image Analysis options: You must set at least one visual feature (or model name) for the 'analyze' operation. Or set segmentation mode for the 'segment' operation`
40+
* `Invalid combination of Image Analysis options: You cannot set both visual features (or model name), and segmentation mode`
41+
42+
Make sure the [ImageAnalysisOptions](/java/api/com.azure.ai.vision.imageanalysis.imageanalysisoptions) object is set correctly to fix these errors.
43+
44+
To help resolve issues, look at the [Image Analysis Samples](https://github.com/Azure-Samples/azure-ai-vision-sdk) repository and run the closest sample to your scenario. Search the [GitHub issues](https://github.com/Azure-Samples/azure-ai-vision-sdk/issues) to see if your issue was already address. If not, create a new.
45+
3146
# [C++](#tab/cpp)
3247

3348
The sample code for getting analysis results shows how to handle errors and get the [ImageAnalysisErrorDetails](/cpp/cognitive-services/vision/imageanalysis-imageanalysiserrordetails) object that contains the error information. The error information includes:

articles/ai-services/computer-vision/includes/setup-sdk/java.md

Lines changed: 30 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -24,79 +24,66 @@ The Azure AI Vision SDK for Java is available as a Maven package. For more infor
2424
Follow these steps to install the Vision SDK for Java using Apache Maven:
2525

2626
1. Install [Apache Maven](https://maven.apache.org/download.cgi). On Linux, install from the distribution repositories if available.
27-
2827
1. Open a command prompt and run `mvn -v` to confirm successful installation.
29-
3028
1. Open a command prompt where you want to place the new project, and create a new pom.xml file.
31-
3229
1. Copy the following XML content into your pom.xml file:
33-
34-
```xml
35-
<project xmlns="http://maven.apache.org/POM/4.0.0"
36-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
37-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
30+
```xml
31+
<project xmlns="http://maven.apache.org/POM/4.0.0"
32+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3834
<modelVersion>4.0.0</modelVersion>
3935
<groupId>azure.ai.vision.imageanalysis.samples</groupId>
4036
<artifactId>image-analysis-quickstart</artifactId>
4137
<version>0.0</version>
4238
<dependencies>
43-
<!-- https://mvnrepository.com/artifact/com.azure/azure-ai-vision-imageanalysis -->
44-
<dependency>
39+
<!-- https://mvnrepository.com/artifact/com.azure/azure-ai-vision-imageanalysis -->
40+
<dependency>
4541
<groupId>com.azure</groupId>
4642
<artifactId>azure-ai-vision-imageanalysis</artifactId>
4743
<version>0.15.1-beta.1</version>
48-
</dependency>
49-
<!-- https://mvnrepository.com/artifact/com.azure/azure-core-http-netty -->
50-
<dependency>
44+
</dependency>
45+
<!-- https://mvnrepository.com/artifact/com.azure/azure-core-http-netty -->
46+
<dependency>
5147
<groupId>com.azure</groupId>
5248
<artifactId>azure-core-http-netty</artifactId>
5349
<version>1.13.6</version>
54-
</dependency>
55-
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
56-
<dependency>
50+
</dependency>
51+
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
52+
<dependency>
5753
<groupId>org.slf4j</groupId>
5854
<artifactId>slf4j-api</artifactId>
5955
<version>2.0.7</version>
60-
</dependency>
61-
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
62-
<dependency>
56+
</dependency>
57+
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
58+
<dependency>
6359
<groupId>org.slf4j</groupId>
6460
<artifactId>slf4j-simple</artifactId>
6561
<version>2.0.7</version>
66-
</dependency>
62+
</dependency>
6763
</dependencies>
68-
</project>
69-
```
70-
64+
</project>
65+
```
7166
1. Update the version value in `<version>0.15.1-beta.1</version>` based on the latest version you find in the Maven repository for the [azure-ai-vision-imageanalysis](https://mvnrepository.com/artifact/com.azure/azure-ai-vision-imageanalysis) package.
72-
7367
1. Run the following Maven command to install the Vision SDK and dependencies.
74-
```console
68+
```console
7569
mvn clean dependency:copy-dependencies
76-
```
77-
78-
2. Verify that the local folder path `target\dependency` was created, and it contains `.jar` files including three file named `azure-ai-vision-*.jar`
70+
```
71+
1. Verify that the local folder path `target\dependency` was created, and it contains `.jar` files including three file named `azure-ai-vision-*.jar`
7972

8073
# [Gradle](#tab/gradle)
8174

8275
1. Install [Gradle](https://gradle.org/install).
83-
8476
1. In a command prompt run `gradle -v` to confirm successful installation.
85-
8677
1. Create you Java application using Gradle. See for example [Building Java Applications Sample](https://docs.gradle.org/8.3/samples/sample_building_java_applications.html).
87-
8878
1. Update your `build.gradle` file by inserting 4 new dependencies:
89-
90-
```gradle
91-
dependencies {
92-
implementation 'com.azure:azure-ai-vision-imageanalysis:0.15.1-beta.1'
93-
implementation 'com.azure:azure-core-http-netty:1.13.6'
94-
implementation 'org.slf4j:slf4j-api:2.0.7'
95-
implementation 'org.slf4j:slf4j-simple:2.0.7'
96-
}
97-
```
98-
79+
```gradle
80+
dependencies {
81+
implementation 'com.azure:azure-ai-vision-imageanalysis:0.15.1-beta.1'
82+
implementation 'com.azure:azure-core-http-netty:1.13.6'
83+
implementation 'org.slf4j:slf4j-api:2.0.7'
84+
implementation 'org.slf4j:slf4j-simple:2.0.7'
85+
}
86+
```
9987
1. Update the version value in `com.azure:azure-ai-vision-imageanalysis:0.15.1-beta.1` based on the latest version you find in the Maven repository for the [azure-ai-vision-imageanalysis](https://mvnrepository.com/artifact/com.azure/azure-ai-vision-imageanalysis) package.
100-
101-
1. Update your Java application with Image Analysis code, compile and run it.
88+
1. Update your Java application to do Image Analysis using the Azure AI Vision SDK, compile and run your application.
10289
---

0 commit comments

Comments
 (0)