Detects non-compliant content in images, such as pornography, terrorism, undesirable scenes, logos, and text-in-image violations.
Operation description
- Before you use this operation, make sure that you understand the billing methods and pricing of Intelligent Media Management.
Important The execution time of asynchronous tasks is not guaranteed.
- Image requirements:
Image URLs support the HTTP and HTTPS protocols.
The following image formats are supported: PNG, JPG, JPEG, BMP, GIF, and WEBP.
The image size cannot exceed 20 MB for both synchronous and asynchronous invocations. The height or width cannot exceed 30,000 pixels, and the total number of pixels cannot exceed 250 million. For GIF images, the total number of pixels cannot exceed 4,194,304, and the height or width cannot exceed 30,000 pixels.
The image download timeout period is 3 seconds. If the download takes longer than 3 seconds, a timeout error is returned.
For best results, the image resolution should be at least 256 × 256 pixels. Low resolution may affect detection accuracy.
The response time for image detection depends on the image download time. Ensure the storage service where the image is stored is stable and reliable. Use Alibaba Cloud Object Storage Service (OSS) or CDN.
This is an asynchronous operation. After a task starts, its information is saved for only 7 days. You cannot query the information after this period. To view task information, you can call the GetTask or ListTasks operation and use the returned
TaskId. Alternatively, you can set the Notification parameter to receive task information through asynchronous notification messages.
The detection results are returned in an asynchronous notification message. The Suggestion field in the message has one of the following values:
pass: The image passed the review. No non-compliant content was detected.
block: The image failed the review. Non-compliant content was detected. The Categories field indicates the non-compliant category. For more information about the categories, see Content Moderation detection results.
review: The image requires manual review. After the manual review is complete, another asynchronous notification message is sent to inform you of the 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 project name. For more information about how to obtain the project name, see Create a project. |
test-project |
| UserData |
string |
No |
The custom information. This information is returned in the asynchronous notification message to help you associate the message with your system. The value can be up to 2,048 bytes long. |
test-data |
| SourceURI |
string |
Yes |
The OSS URI of the image. The URI must follow the |
oss://test-bucket/test-object |
| Tags |
object |
No |
The custom tags. You can use tags to search for 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 image detection scenario. Valid values:
Note
If you do not specify a detection scenario, the Valid values:
|
porn |
|
| Interval |
integer |
No |
The frame capture frequency. This parameter is used for GIF and long image detection. The default value is 1. |
2 |
| MaxFrames |
integer |
No |
The maximum number of frames to capture. This parameter is used for GIF and long image detection. The default value is 1. |
10 |
| Notification | Notification |
No |
The notification configuration. 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 task ID. |
ImageModeration-179ef4f8-d583-4f0c-a293-7c0889c***** |
| EventId |
string |
The event ID. |
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.