CreateImageModerationTask
Checks whether image content is compliant, including detection scenarios such as pornography, terrorism and political content, undesirable scenes, logos, and text and image violations.
Operation description
- Before you call this operation, make sure that you fully understand the billing methods and pricing of Intelligent Media Management.
Important Asynchronous tasks do not guarantee timeliness.
- Image requirements:
Image URLs support the following protocols: HTTP and HTTPS.
Images support the following formats: PNG, JPG, JPEG, BMP, GIF, and WEBP.
The image size is limited to 20 MB (applicable to both synchronous and asynchronous calls). The height or width cannot exceed 30,000 pixels (px), and the total number of pixels cannot exceed 250 million (px). For GIF images, the total number of pixels cannot exceed 4,194,304 (px), and the height or width cannot exceed 30,000 pixels (px).
The image download time is limited to 3 seconds. If the download time exceeds 3 seconds, a download timeout error is returned.
We recommend that the image resolution be no less than 256 × 256 px. A low resolution may affect the recognition effect.
The response time of the image detection API operation depends on the image download time. Make sure that the storage service where the detected images are stored is stable and reliable. We recommend that you use Alibaba Cloud OSS or CDN caching.
This operation is asynchronous. After a task starts, the task information is retained for only 7 days. You cannot obtain the task information after 7 days. Call the GetTask or ListTasks operation to obtain the returned
TaskIdand view the task information. You can also set the Notification parameter to obtain the task information through message notifications.
Detection results are returned through asynchronous message notifications. Valid values of the Suggestion field in asynchronous message notifications:
pass: The image passes the check. No non-compliant content is detected.
block: Non-compliant content is detected. The Categories field indicates the non-compliant categories. For more information, see content moderation results.
review: Manual review is required. After the manual review is completed, another asynchronous message notification is sent to inform you of the review result.>
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
imm:CreateImageModerationTask |
create |
*Project
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ProjectName |
string |
Yes |
The name of the project. For more information about how to obtain the project name, see Create a project. |
test-project |
| UserData |
string |
No |
The custom user information. This information is returned in asynchronous message notifications to help you associate and process message notifications in your system. The maximum length is 2,048 bytes. |
test-data |
| SourceURI |
string |
Yes |
The OSS URL of the image. The OSS URL format is |
oss://test-bucket/test-object |
| Tags |
object |
No |
The custom tags used to search and filter asynchronous tasks. |
{ "User": "Jane" } |
| CredentialConfig | CredentialConfig |
No |
The chained authorization configuration. This parameter is optional. For more information, see Use chained authorization to access resources of other entities. |
|
| Scenes |
array |
No |
The image detection scenarios. |
|
|
string |
No |
The specified image detection scenarios. Valid values:
Note
If you do not specify detection scenarios, the Valid values:
|
porn |
|
| Interval |
integer |
No |
The frame capture frequency. This parameter is dedicated to GIF and long image detection. Default value: 1. |
2 |
| MaxFrames |
integer |
No |
The maximum number of captured frames. This parameter is dedicated to GIF and long image detection. Default value: 1. |
10 |
| Notification | Notification |
No |
The message notification configuration. For more information, click Notification. For more information about the format of asynchronous notification messages, see Asynchronous notification message format. |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response struct. |
||
| RequestId |
string |
The ID of the request. |
1B3D5E0A-D8B8-4DA0-8127-ED32C851**** |
| TaskId |
string |
The ID of the task. |
ImageModeration-179ef4f8-d583-4f0c-a293-7c0889c***** |
| EventId |
string |
The ID of the event. |
2E6-1I0FGn0zFnl5AflRfhzClma***** |
Examples
Success response
JSON format
{
"RequestId": "1B3D5E0A-D8B8-4DA0-8127-ED32C851****",
"TaskId": "ImageModeration-179ef4f8-d583-4f0c-a293-7c0889c*****",
"EventId": "2E6-1I0FGn0zFnl5AflRfhzClma*****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.