Image Review Interface
API description
This API enables the use of the image review service. The image review service is an intelligent solution provided by Baidu AI Cloud, offering multidimensional image reviews, including pornography detection, violent and terrorism-related content identification, political sensitivity assessment, disgust image recognition, and advertisement detection, among others.
Note: To use this API, you need to enable the image review service on the console first. url: The fixed value is $(img-censor), which cannot be modified. parameters: This value is based on base64 encoding of the image review function parameters. The image review function parameters remain a JSON string.
The list of sub-services supported by the image review service includes:
- ocr: General optical character recognition
- face: Face detection
- antiporn: Pornography recognition
- politician: Politician recognition
- terror: Violent terrorism recognition
- public: Public figure recognition
- disgust: Disgusting image recognition
- watermark: Watermark QR code recognition
- quality: Denotes image quality recognition values corresponding to underlying service parameters. Refer to the input parameters for the Hetu general optical character recognition (OCR) service for more details.
Detailed explanations of request and response parameters for sub-services are provided below.
Request URI
POST /v1/{bucketName}/{objectKey}?process
| Parameter name | Parameter type | Required or not | Description | Example value | Parameter location |
|---|---|---|---|---|---|
| bucketName | String | Yes | Bucket name | "bucketName_example" | Path |
| objectKey | String | Yes | Object name | "objectKey_example" | Path |
Parameters of request body
Description of the data structure of request body fields
| Parameter name | Parameter type | Required or not | Description | Example value |
|---|---|---|---|---|
| action | Action | No |
Description of Action field data structure
| Parameter name | Parameter type | Required or not | Description | Example value |
|---|---|---|---|---|
| sync | List |
No |
Description of Sync field data structure
| Parameter name | Parameter type | Required or not | Description | Example value |
|---|---|---|---|---|
| url | String | No | The fixed value is $(img-censor), which cannot be modified | $(img-censor) |
| parameters | String | No | This parameter should be provided as a base64-encoded JSON string containing the image review function configuration. | <base64_encode(param)> |
Response body parameters
Description of the data structure of response body fields
Request example
1POST /v1/bucketName_example/objectKey_example?process
2 <Common request headers>
3{
4 "action" : {
5 "sync" : [ {
6 "parameters" : "<base64_encode(param)>",
7 "url" : "$(img-censor)"
8 } ]
9 }
10}
Response example
1HTTP/1.1 200 OK
2 <Common response headers>
3{ }
Error code
Please refer to the general error codes
