imagerecognition

command module
v0.0.0-...-8835833 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

README


{ "image": "direktiv/imagerecognition", "desc": "Checks an image to see if it is safe for work and responds with content is likely to be racy, adult or violence themed." }

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: direktiv/imagerecognition:v1
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"
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL