You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-services/computer-vision/how-to/call-analyze-image.md
+16-21Lines changed: 16 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ ms.date: 11/01/2024
13
13
14
14
# Call the Image Analysis 3.2 API
15
15
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.
17
17
18
18
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).
19
19
@@ -25,44 +25,39 @@ The code in this guide uses remote images referenced by URL. You might want to t
25
25
26
26
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"}`.
27
27
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.
30
29
31
30
#### [C#](#tab/csharp)
32
31
33
32
In your main class, save a reference to the URL of the image you want to analyze.
> 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.
39
37
40
38
#### [Java](#tab/java)
41
39
42
40
In your main class, save a reference to the URL of the image you want to analyze.
> 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.
48
45
49
46
#### [JavaScript](#tab/javascript)
50
47
51
48
In your main function, save a reference to the URL of the image you want to analyze.
> 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.
57
53
58
54
#### [Python](#tab/python)
59
55
60
56
Save a reference to the URL of the image you want to analyze.
> 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.
66
61
67
62
---
68
63
@@ -222,7 +217,7 @@ This section shows you how to parse the results of the API call. It includes the
222
217
> [!NOTE]
223
218
> **Scoped API calls**
224
219
>
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.
226
221
227
222
#### [REST](#tab/rest)
228
223
@@ -269,20 +264,20 @@ The service returns a `200` HTTP response, and the body contains the returned da
269
264
See the following list of possible errors and their causes:
270
265
271
266
* 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.
0 commit comments