Sign inSign up

vorteil/imagerecognition

By vorteil

Updated about 5 years ago

Image
0

1.6K

vorteil/imagerecognition repository overview

ImageRecognition

Checks an image to see if it is safe for work and responds with content is likely to be racy, adult or violence themed.

Direktiv

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(.)

Input

The input needed to run the above workflow properly is the following:

input:
  url: "IMAGE_TO_URL"
  serviceAccountKey: jq(.secrets.SERVICE_ACCOUNT_KEY)

Output

If the action is successful, the image recognition container will respond with the following JSON.

{
    "safeForWork": false,
    "violenceLikelihood": "LIKELY",
    "racyLikelihood": "VERY_LIKELY",
    "adultLikelihood": "UNLIKELY"
}

Error

In the case that an error is encountered, it will present in the following format:

{
    "errorCode": "com.imagerecognition.error",
    "errorMsg": "Something went wrong"
}

Tag summary

Content type

Image

Digest

Size

4.5 MB

Last updated

about 5 years ago

docker pull vorteil/imagerecognition