The Image Moderation APIs are entirely automated. While they have been trained to achieve best-in-class accuracy, there might be instances where an image is not classified as per your expectations.
In such cases, you can submit the image to the Feedback API. Images submitted to the Feedback API are used to improve the models on a continuous basis. Submitting an image to the Feedback API does not count as an operation and will not impact your billing.
To submit an image to the Feedback API, you need three things:
If you do not know which model the image was moderated with, nor what the expected class should be, you can submit unknown.
The full list of acceptable model and class names is available here:
Model | Possible classes |
nudity | safe partial raw bikini chest cleavage lingerie unknown |
nudity-2.0 | safe sexual_activity sexual_display erotica bikini male_chest cleavage lingerie miniskirt male_underwear miniskirt unknown |
nudity-2.1 | safe sexual_activity sexual_display erotica bikini male_chest cleavage lingerie miniskirt male_underwear miniskirt unknown |
gore | safe gore unknown |
gore-2.0 | safe gore unknown |
type | photo illustration unknown |
face | none single multiple unknown |
wad | no-weapons weapons no-alcohol alcohol no-drugs drugs unknown |
weapon | no-weapons weapons unknown |
recreational_drug | no-drugs drugs unknown |
alcohol | no-alcohol alcohol unknown |
celebrities | no-celebrity celebrity unknown |
text | no-text text-artificial text-natural unknown |
offensive | not-offensive offensive unknown |
scam | not-scam scam unknown |
minor | no-minor minor unknown |
gender | male female unknown |
tobacco | no-tobacco tobacco unknown |
gambling | no-gambling gambling unknown |
money | no-money money unknown |
text-content | safe unsafe unknown |
qr-content | safe unsafe unknown |
genai | ai not-ai |
unknown | unknown miss safe |
Once you have the image, the model name and the class name, you can submit the image to the API. The request is very similar to the request done for Image Moderation and use your API credentials to authenticate the call:
curl -X POST 'https://api.sightengine.com/1.0/feedback.json' \
-F 'url=https://example.com/path/image.jpg' \
-F 'model=nudity-2.0' \
-F 'class=safe' \
-F 'api_user={api_user}' \
-F 'api_secret={api_secret}'
curl -X POST 'https://api.sightengine.com/1.0/feedback.json' \
-F 'media=@/path/to/image.jpg' \
-F 'model=wad' \
-F 'class=weapons' \
-F 'api_user={api_user}' \
-F 'api_secret={api_secret}'
The response received from the API will acknowledge the request with a response like this:
{
"status": "success",
"request": {
"id": "req_VjyxevVQYXQZ1HMbnwtn",
"timestamp": 1471762434.0244,
"operations": 0
},
"media": {
"id": "med_KWmB2GQZ29N4MVpVdq5K",
"uri": "/path/to/image.jpg"
},
"message": "Thank you!"
}
Was this page helpful?