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
[vision] Migrate vision projects to use snippets extraction (#33222)
### Packages impacted by this PR
- @azure-rest/ai-vision-image-analysis
### Issues associated with this PR
- #32416
### Describe the problem that is addressed by this PR
Updates all projects under `vision` to use snippets extraction.
### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?
### Are there test cases added in this PR? _(If not, why?)_
### Provide a list of related PRs _(if any)_
### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_
### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
Copy file name to clipboardexpand all lines: sdk/vision/ai-vision-image-analysis-rest/README.md
+176-74
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,13 @@
3
3
The Image Analysis service provides AI algorithms for processing images and returning information about their content. In a single service call, you can extract one or more visual features from the image simultaneously, including getting a caption for the image, extracting text shown in the image (OCR) and detecting objects. For more information on the service and the supported visual features, see [Image Analysis overview][image_analysis_overview], and the [Concepts][image_analysis_concepts] page.
4
4
5
5
Use the Image Analysis client library to:
6
-
* Authenticate against the service
7
-
* Set what features you would like to extract
8
-
* Upload an image for analysis, or send an image URL
9
-
* Get the analysis result
10
6
11
-
[Product documentation][image_analysis_overview]
7
+
- Authenticate against the service
8
+
- Set what features you would like to extract
9
+
- Upload an image for analysis, or send an image URL
@@ -28,9 +29,9 @@ See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUP
28
29
29
30
- An [Azure subscription](https://azure.microsoft.com/free).
30
31
- A [Computer Vision resource](https://portal.azure.com/#create/Microsoft.CognitiveServicesComputerVision) in your Azure subscription.
31
-
* You will need the key and endpoint from this resource to authenticate against the service.
32
-
* You can use the free pricing tier (`F0`) to try the service, and upgrade later to a paid tier for production.
33
-
* Note that in order to run Image Analysis with the `Caption` or `Dense Captions` features, the Azure resource needs to be from one of the following GPU-supported regions: `East US`, `France Central`, `Korea Central`, `North Europe`, `Southeast Asia`, `West Europe`, or `West US`.
32
+
- You will need the key and endpoint from this resource to authenticate against the service.
33
+
- You can use the free pricing tier (`F0`) to try the service, and upgrade later to a paid tier for production.
34
+
- Note that in order to run Image Analysis with the `Caption` or `Dense Captions` features, the Azure resource needs to be from one of the following GPU-supported regions: `East US`, `France Central`, `Korea Central`, `North Europe`, `Southeast Asia`, `West Europe`, or `West US`.
34
35
35
36
### Install the `@azure-rest/ai-vision-image-analysis` package
36
37
@@ -64,9 +65,9 @@ For more information about these features, see [Image Analysis overview][image_a
64
65
65
66
Image Analysis works on images that meet the following requirements:
66
67
67
-
* The image must be presented in JPEG, PNG, GIF, BMP, WEBP, ICO, TIFF, or MPO format
68
-
* The file size of the image must be less than 20 megabytes (MB)
69
-
* The dimensions of the image must be greater than 50 x 50 pixels and less than 16,000 x 16,000 pixels
68
+
- The image must be presented in JPEG, PNG, GIF, BMP, WEBP, ICO, TIFF, or MPO format
69
+
- The file size of the image must be less than 20 megabytes (MB)
70
+
- The dimensions of the image must be greater than 50 x 50 pixels and less than 16,000 x 16,000 pixels
70
71
71
72
### ImageAnalysisClient
72
73
@@ -78,26 +79,20 @@ The `ImageAnalysisClient` is the primary interface for developers interacting wi
78
79
79
80
Here's an example of how to create an `ImageAnalysisClient` instance using a key-based authentication.
#### Create ImageAnalysisClient with a Microsoft Entra ID Credential
99
93
100
94
**Prerequisites for Entra ID Authentication**:
95
+
101
96
- The role `Cognitive Services User` assigned to you. Role assignment can be done via the "Access Control (IAM)" tab of your Computer Vision resource in the Azure portal.
This example demonstrates how to extract printed or hand-written text for the image file [sample.jpg](https://aka.ms/azsdk/image-analysis/sample.jpg) using the ImageAnalysisClient. The method call returns an ImageAnalysisResult object. The ReadResult property on the returned object includes a list of text lines and a bounding polygon surrounding each text line. For each line, it also returns a list of words in the text line and a bounding polygon surrounding each word.
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
206
308
207
-
```javascript
208
-
const { setLogLevel } =require("@azure/logger");
309
+
```ts snippet:SetLogLevel
310
+
import { setLogLevel } from"@azure/logger";
209
311
210
312
setLogLevel("info");
211
313
```
@@ -228,4 +330,4 @@ If you'd like to contribute to this library, please read the [contributing guide
0 commit comments