Skip to content

Commit babecc2

Browse files
committed
Add edit
1 parent 8f999fa commit babecc2

File tree

1 file changed

+16
-21
lines changed

1 file changed

+16
-21
lines changed

articles/ai-services/computer-vision/how-to/call-analyze-image.md

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ms.date: 11/01/2024
1313

1414
# Call the Image Analysis 3.2 API
1515

16-
This article demonstrates how to call the Image Analysis API version 3.2 to return information about an image's visual features. It also shows you how to parse the returned information using the client SDKs or REST API.
16+
This article demonstrates how to call the Image Analysis version 3.2 API to return information about an image's visual features. It also shows you how to parse the returned information using the client SDKs or REST API.
1717

1818
This guide assumes you've already [created a Vision resource](https://portal.azure.com/#create/Microsoft.CognitiveServicesComputerVision) and obtained a key and an endpoint URL. If you're using a client SDK, you also need to authenticate a client object. For more information about these steps, see the [Image Analysis quickstart](../quickstarts-sdk/image-analysis-client-library.md).
1919

@@ -25,44 +25,39 @@ The code in this guide uses remote images referenced by URL. You might want to t
2525

2626
When analyzing a remote image, you specify the image's URL by formatting the request body like this: `{"url":"http://example.com/images/test.jpg"}`.
2727

28-
> [!TIP]
29-
> To analyze a local image, put the binary image data in the HTTP request body.
28+
To analyze a local image, put the binary image data in the HTTP request body.
3029

3130
#### [C#](#tab/csharp)
3231

3332
In your main class, save a reference to the URL of the image you want to analyze.
3433

3534
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/ComputerVision/ImageAnalysisQuickstart.cs?name=snippet_analyze_url)]
3635

37-
> [!TIP]
38-
> To analyze a local image, see the [ComputerVisionClient](/dotnet/api/microsoft.azure.cognitiveservices.vision.computervision.computervisionclient) methods, such as `AnalyzeImageInStreamAsync`. Or, see the sample code on [GitHub](https://github.com/Azure-Samples/cognitive-services-quickstart-code/blob/master/dotnet/ComputerVision/ImageAnalysisQuickstart.cs) for scenarios involving local images.
36+
To analyze a local image, see the [ComputerVisionClient](/dotnet/api/microsoft.azure.cognitiveservices.vision.computervision.computervisionclient) methods, such as `AnalyzeImageInStreamAsync`. Or, see the sample code on [GitHub](https://github.com/Azure-Samples/cognitive-services-quickstart-code/blob/master/dotnet/ComputerVision/ImageAnalysisQuickstart.cs) for scenarios involving local images.
3937

4038
#### [Java](#tab/java)
4139

4240
In your main class, save a reference to the URL of the image you want to analyze.
4341

4442
[!code-java[](~/cognitive-services-quickstart-code/java/ComputerVision/src/main/java/ImageAnalysisQuickstart.java?name=snippet_urlimage)]
4543

46-
> [!TIP]
47-
> To analyze a local image, see the [ComputerVision](/java/api/com.microsoft.azure.cognitiveservices.vision.computervision.computervision) methods, such as `AnalyzeImage`. Or, see the sample code on [GitHub](https://github.com/Azure-Samples/cognitive-services-quickstart-code/blob/master/java/ComputerVision/src/main/java/ImageAnalysisQuickstart.java) for scenarios involving local images.
44+
To analyze a local image, see the [ComputerVision](/java/api/com.microsoft.azure.cognitiveservices.vision.computervision.computervision) methods, such as `AnalyzeImage`. Or, see the sample code on [GitHub](https://github.com/Azure-Samples/cognitive-services-quickstart-code/blob/master/java/ComputerVision/src/main/java/ImageAnalysisQuickstart.java) for scenarios involving local images.
4845

4946
#### [JavaScript](#tab/javascript)
5047

5148
In your main function, save a reference to the URL of the image you want to analyze.
5249

5350
[!code-javascript[](~/cognitive-services-quickstart-code/javascript/ComputerVision/ImageAnalysisQuickstart.js?name=snippet_describe_image)]
5451

55-
> [!TIP]
56-
> To analyze a local image, see the [ComputerVisionClient](/javascript/api/@azure/cognitiveservices-computervision/computervisionclient) methods, such as `describeImageInStream`. Or, see the sample code on [GitHub](https://github.com/Azure-Samples/cognitive-services-quickstart-code/blob/master/javascript/ComputerVision/ImageAnalysisQuickstart.js) for scenarios involving local images.
52+
To analyze a local image, see the [ComputerVisionClient](/javascript/api/@azure/cognitiveservices-computervision/computervisionclient) methods, such as `describeImageInStream`. Or, see the sample code on [GitHub](https://github.com/Azure-Samples/cognitive-services-quickstart-code/blob/master/javascript/ComputerVision/ImageAnalysisQuickstart.js) for scenarios involving local images.
5753

5854
#### [Python](#tab/python)
5955

6056
Save a reference to the URL of the image you want to analyze.
6157

6258
[!code-python[](~/cognitive-services-quickstart-code/python/ComputerVision/ImageAnalysisQuickstart.py?name=snippet_remoteimage)]
6359

64-
> [!TIP]
65-
> To analyze a local image, see the [ComputerVisionClientOperationsMixin](/python/api/azure-cognitiveservices-vision-computervision/azure.cognitiveservices.vision.computervision.operations.computervisionclientoperationsmixin) methods, such as `analyze_image_in_stream`. Or, see the sample code on [GitHub](https://github.com/Azure-Samples/cognitive-services-quickstart-code/blob/master/python/ComputerVision/ImageAnalysisQuickstart.py) for scenarios involving local images.
60+
To analyze a local image, see the [ComputerVisionClientOperationsMixin](/python/api/azure-cognitiveservices-vision-computervision/azure.cognitiveservices.vision.computervision.operations.computervisionclientoperationsmixin) methods, such as `analyze_image_in_stream`. Or, see the sample code on [GitHub](https://github.com/Azure-Samples/cognitive-services-quickstart-code/blob/master/python/ComputerVision/ImageAnalysisQuickstart.py) for scenarios involving local images.
6661

6762
---
6863

@@ -222,7 +217,7 @@ This section shows you how to parse the results of the API call. It includes the
222217
> [!NOTE]
223218
> **Scoped API calls**
224219
>
225-
> Some of the features in Image Analysis can be called either directly or through the Analyze API call. For example, you can do a scoped analysis of only image tags by making a request to `<endpoint>/vision/v3.2/tag` (or to the corresponding method in the SDK). See the [reference documentation](/rest/api/computervision/operation-groups?view=rest-computervision-v3.2) for other features that can be called separately.
220+
> Some of the features in Image Analysis can be called either directly or through the Analyze API call. For example, you can do a scoped analysis of only image tags by making a request to `<endpoint>/vision/v3.2/tag` (or to the corresponding method in the SDK). See the [reference documentation](/rest/api/computervision/operation-groups?view=rest-computervision-v3.2&preserve-view=true) for other features that can be called separately.
226221
227222
#### [REST](#tab/rest)
228223

@@ -269,20 +264,20 @@ The service returns a `200` HTTP response, and the body contains the returned da
269264
See the following list of possible errors and their causes:
270265

271266
* 400
272-
* `InvalidImageUrl` - Image URL is badly formatted or not accessible.
273-
* `InvalidImageFormat` - Input data isn't a valid image.
274-
* `InvalidImageSize` - Input image is too large.
275-
* `NotSupportedVisualFeature` - Specified feature type isn't valid.
276-
* `NotSupportedImage` - Unsupported image, for example child pornography.
277-
* `InvalidDetails` - Unsupported `detail` parameter value.
278-
* `NotSupportedLanguage` - The requested operation isn't supported in the language specified.
279-
* `BadArgument` - More details are provided in the error message.
267+
* `InvalidImageUrl` - Image URL is badly formatted or not accessible
268+
* `InvalidImageFormat` - Input data isn't a valid image
269+
* `InvalidImageSize` - Input image is too large
270+
* `NotSupportedVisualFeature` - Specified feature type isn't valid
271+
* `NotSupportedImage` - Unsupported image, for example child pornography
272+
* `InvalidDetails` - Unsupported `detail` parameter value
273+
* `NotSupportedLanguage` - The requested operation isn't supported in the language specified
274+
* `BadArgument` - More details are provided in the error message
280275
* 415 - Unsupported media type error. The Content-Type isn't in the allowed types:
281276
* For an image URL, Content-Type should be `application/json`
282277
* For a binary image data, Content-Type should be `application/octet-stream` or `multipart/form-data`
283278
* 500
284279
* `FailedToProcess`
285-
* `Timeout` - Image processing timed out.
280+
* `Timeout` - Image processing timed out
286281
* `InternalServerError`
287282

288283

0 commit comments

Comments
 (0)