Checks an image to see if it is safe for work and responds with content is likely to be racy, adult or violence themed.
An example workflow of using the container on Direktiv.
id: check-image
functions:
- id: check
image: vorteil/imagerecognition:v2
description: "Evaluates an image using Google Vision API"
states:
- id: checkImage
type: action
action:
function: check
input: jq(.)
The input needed to run the above workflow properly is the following:
input:
url: "IMAGE_TO_URL"
serviceAccountKey: jq(.secrets.SERVICE_ACCOUNT_KEY)
If the action is successful, the image recognition container will respond with the following JSON.
{
"safeForWork": false,
"violenceLikelihood": "LIKELY",
"racyLikelihood": "VERY_LIKELY",
"adultLikelihood": "UNLIKELY"
}
In the case that an error is encountered, it will present in the following format:
{
"errorCode": "com.imagerecognition.error",
"errorMsg": "Something went wrong"
}
Content type
Image
Digest
Size
4.5 MB
Last updated
about 5 years ago
docker pull vorteil/imagerecognition