All Products
Search
Document Center

Intelligent Media Management:GetImageModerationResult

Last Updated:Dec 11, 2024

Queries an image compliance detection task.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
imm:GetImageModerationResultget
*Project
acs:imm:{#regionId}:{#accountId}:project/{#ProjectName}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ProjectNamestringYes

The name of the project.

test-project
TaskTypestringYes

The type of the task.

ImageModeration
TaskIdstringYes

The task ID.

ImageModeration-ff207203-3f93-4645-a041-7b8f0f******

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

E6A120B1-BEB3-0F63-A7C2-0783B6******
ProjectNamestring

The name of the project.

test-project
EventIdstring

The event ID.

1B6-1XBMX3BixLMILvXVGtlkr******
Statusstring

The task status. Valid values:

  • Running
  • Succeeded
  • Failed
Succeeded
Codestring

The error code of the task.

ResourceNotFound
Messagestring

The error message of the task.

The specified resource TaskId is not found.
StartTimestring

The start time of the task.

2023-04-03T09:44:31.029Z
EndTimestring

The end time of the task.

2023-04-03T09:44:32Z
UserDatastring

The custom information.

{ "fileId": "123" }
TaskTypestring

The type of the task.

ImageModeration
TaskIdstring

The task ID.

ImageModeration-ff207203-3f93-4645-a041-7b8f0f******
ModerationResultobject

The result of the image compliance detection task.

URIstring

The OSS URI of the file. The URI follows the oss://${bucketname}/${objectname} format. bucketname indicates the name of an OSS bucket that is in the same region as the current project, and objectname is the file path.

oss://test-bucket/test-object
Suggestionstring

The recommended operation. Valid values:

  • pass: The image has passed the check. No action is required.
  • review: The image contains suspected violations and requires human review.
  • block: The image contains violations. Further actions, such as deleting or blocking the image, are recommended.
block
Categoriesarray

List of categories.

Categoriesstring

The category.

porn
Framesobject

The information about video and motion detection frames.

TotalCountinteger

The total number of detected frames.

30
BlockFramesarray<object>

The violated frames.

BlockFramesobject

The information about violated frames.

Ratedouble

The confidence level of the violation.

30
Offsetinteger

The offset of the frame.

2
Labelstring

The label of the violation.

{ "test": "val" }

Examples

Sample success responses

JSONformat

{
  "RequestId": "E6A120B1-BEB3-0F63-A7C2-0783B6******",
  "ProjectName": "test-project",
  "EventId": "1B6-1XBMX3BixLMILvXVGtlkr******",
  "Status": "Succeeded",
  "Code": "ResourceNotFound",
  "Message": "The specified resource TaskId is not found.",
  "StartTime": "2023-04-03T09:44:31.029Z",
  "EndTime": "2023-04-03T09:44:32Z",
  "UserData": "{\n      \"fileId\": \"123\"\n}",
  "TaskType": "ImageModeration",
  "TaskId": "ImageModeration-ff207203-3f93-4645-a041-7b8f0f******",
  "ModerationResult": {
    "URI": "oss://test-bucket/test-object",
    "Suggestion": "block",
    "Categories": [
      "porn"
    ],
    "Frames": {
      "TotalCount": 30,
      "BlockFrames": [
        {
          "Rate": 30,
          "Offset": 2,
          "Label": "{\n      \"test\": \"val\"\n}"
        }
      ]
    }
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history