Image Moderation
Description
Zia Image Moderation detects and recognizes inappropriate and unsafe content in images. The criteria include suggestive or explicit racy content, nudity, violence, gore, bloodshed, and the presence of weapons and drugs.
This API recognizes the following inappropriate content in images and returns them in the response: racy, weapon, nudity, gore, drug. The response also contains the probability of each criteria with their confidence scores, and the prediction of the image being safe_to_use or unsafe_to_use.
You must specify the path of the image in the API request, as shown in the sample request. You can also optionally set the moderation mode for the request.
Request URL
https://api.catalyst.zoho.com/baas/v1/project/{project_id}/ml/imagemoderation
project_id - The unique ID of the project
Request Headers
Authorization: Zoho-oauthtoken 1000.910***************************16.2f****************************57
content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Request Method
POST
Scope
scope=ZohoCatalyst.mlkit.READ
Form-Data Properties
Parameter Name | Data Type | Mandatory | Default Value (if not set) | Description |
---|---|---|---|---|
image | File | Yes | N/A | The input file to be processed You must provide the path to it in your local system. Allowed formats: .jpg, .jpeg, .png File size limit: 10 MB |
mode | String | No | advanced | Denotes the moderation mode
|
SDK documentation
Sample Request: Basic
curl -X POST \
https://api.catalyst.zoho.com/baas/v1/project/4000000006007/ml/imagemoderation \
-H "Authorization: Zoho-oauthtoken 1000.910***************************16.2f****************************57" \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-F 'image=/Desktop/SampleImage.jpg' \
-F 'mode=basic'
Sample Response: Basic
{
"probability": {
"nudity": "1.0"
},
"confidence": 1,
"prediction": "unsafe_to_use"
}
Sample Request: Moderate
curl -X POST \
https://api.catalyst.zoho.com/baas/v1/project/4000000006007/ml/imagemoderation \
-H "Authorization: Zoho-oauthtoken 1000.910***************************16.2f****************************57" \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-F 'image=/Desktop/SampleImage.jpg' \
-F 'mode=moderate'
Sample Response: Moderate
{
"probability": {
"racy": "0.0",
"nudity": "0.0"
},
"confidence": 0.9,
"prediction": "safe_to_use"
}
Sample Request: Advanced
curl -X POST \
https://api.catalyst.zoho.com/baas/v1/project/4000000006007/ml/imagemoderation \
-H "Authorization: Zoho-oauthtoken 1000.910***************************16.2f****************************57" \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-F 'image=/Desktop/SampleImage.jpg' \
-F 'mode=advanced'
Sample Response: Advanced
{
"probability": {
"racy": "0.0",
"weapon": "1.0",
"nudity": "0.0",
"gore": "0.0",
"drug": "0.0"
},
"confidence": 1,
"prediction": "unsafe_to_use"
}