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/content-safety/includes/quickstarts/rest-quickstart-image.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ The following section walks through a sample image moderation request with cURL.
27
27
28
28
Choose a sample image to analyze, and download it to your device.
29
29
30
-
We support JPEG, PNG, GIF, BMP, TIFF, or WEBP image formats. The maximum size for image submissions is 4 MB, and image dimensions must be between 50 x 50 pixels and 7,200 x 7,200 pixels. If your format is animated, we'll extract the first frame to do the detection.
30
+
See [Input requirements](./overview.md#input-requirements)for the image limitations. If your format is animated, the service will extract the first frame to do the analysis.
31
31
32
32
You can input your image by one of two methods: **local filestream** or **blob storage URL**.
33
33
-**Local filestream** (recommended): Encode your image to base64. You can use a website like [codebeautify](https://codebeautify.org/image-to-base64-converter) to do the encoding. Then save the encoded string to a temporary location.
@@ -39,7 +39,7 @@ You can input your image by one of two methods: **local filestream** or **blob s
39
39
40
40
Paste the command below into a text editor, and make the following changes.
41
41
42
-
1.Substitute the`<endpoint>` with your resource endpoint URL.
42
+
1.Replace`<endpoint>` with your resource endpoint URL.
43
43
1. Replace `<your_subscription_key>` with your key.
44
44
1. Populate the `"image"` field in the body with either a `"content"` field or a `"blobUrl"` field. For example: `{"image": {"content": "<base_64_string>"}` or `{"image": {"blobUrl": "<your_storage_url>"}`.
45
45
@@ -57,7 +57,7 @@ curl --location --request POST '<endpoint>/contentsafety/image:analyze?api-versi
57
57
```
58
58
59
59
> [!NOTE]
60
-
> If you're using a blob storage URL, the request body will look like this:
60
+
> If you're using a blob storage URL, the request body should look like this:
61
61
>
62
62
> ```
63
63
> {
@@ -67,8 +67,6 @@ curl --location --request POST '<endpoint>/contentsafety/image:analyze?api-versi
67
67
> }
68
68
> ```
69
69
70
-
Open a command prompt window and run the cURL command.
71
-
72
70
The below fields must be included in the URL:
73
71
74
72
| Name |Required? | Description | Type |
@@ -83,6 +81,9 @@ The parameters in the request body are defined in this table:
83
81
| **categories** | Optional | This is assumed to be an array of category names. See the [Harm categories guide](../../concepts/harm-categories.md) for a list of available category names. If no categories are specified, all four categories are used. We use multiple categories to get scores in a single request. | String |
84
82
| **outputType** | Optional | Image moderation API only supports `"FourSeverityLevels"`. Output severities in four levels. The value can be `0,2,4,6` | String|
85
83
84
+
Open a command prompt window and run the cURL command.
85
+
86
+
86
87
### Output
87
88
88
89
You should see the image moderation results displayed as JSON data in the console. For example:
0 commit comments