Loading...

Image Moderation

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.

Execute Image Moderation

Description

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 Details

Request URL

POST

{api-domain}/baas/v1/project/{project_id}/ml/imagemoderation

copy

api-domain
URL
The DC-specific domain to access Catalyst API

project_id
Numerical
The unique ID of the project

Request Headers

Authorization: Zoho-oauthtoken {oauth_token}
content-type: multipart/form-data; boundary=—-WebKitFormBoundary7MA4YWxkTrZu0gW

Optional Headers

CATALYST-ORG: {org_id}

Environment: Development

Scope

ZohoCatalyst.mlkit.READ

Request JSON Properties

file file
mandatory

The input file to be processed.

Allowed formats: .webp, .jpeg, .png, .txt
File size limit: 10 MB

mode string
optional

Denotes the moderation mode

Allowed values: basic, moderate, advanced
Default value: advanced

  • basic: Detects nudity alone
  • moderate: Detects nudity and racy content
  • advanced: Detects all criteria mentioned in the description

Response Details

The response will contain the probability of the parameters detected, based on the mode set in the API request. Based on an aggregate of the detected parameters, it will also include the prediction of the image being safe or unsafe to use, along with a confidence score of the prediction.

Sample Request: Basic
copy

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 “file=@attachment1.txt”
-d ‘{ “mode”: “basic” }’

View more
Sample Response: Basic
copy
{
"probability": {
"nudity": "1.0"
},
"confidence": 1,
"prediction": "unsafe_to_use"
}
View more
Sample Request: Moderate
copy

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 “file=@attachment1.txt”
-d ‘{ “mode”: “moderate” }’

View more
Sample Response: Moderate
copy
{
"probability": {
"racy": "0.0",
"nudity": "0.0"
},
"confidence": 0.9,
"prediction": "safe_to_use"
}
View more
Sample Request: Advanced
copy

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 “file=@attachment1.txt”
-d ‘{ “mode”: “advanced” }’

View more
Sample Response: Advanced
copy
{
"probability": {
"racy": "0.0",
"weapon": "1.0",
"nudity": "0.0",
"gore": "0.0",
"drug": "0.0"
},
"confidence": 1,
"prediction": "unsafe_to_use"
}
View more