CLIP

This API runs a general-purpose image classifier.
It compares each item in a list of prompts to each item in a list of image URLs.

Add this to your node.js code:

const booste = require('booste');

const out = await booste.clip(apiKey, prompts, images)

Arguments:

Arg Description Required Type Example
apiKey Your API key, found on the User Dashboard True string "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
prompts A list of potential captions to assess against the image(s). True array [string] ["A photo of a dog.", "A basketball."]
images A list of images to assess against the prompt(s). Can be either URLs or local paths to the images. True array [string] ["https://upload.wikimedia.org/wikipedia/commons/7/7a/Basketball.png", "./my-dog.jpg"]

Return Type:

Dict - a json blob of the following shape:

{
     "A photo of a dog.": {
          "https://upload.wikimedia.org/wikipedia/commons/7/7a/Basketball.png": {
               "similarity" : 0.2056
          }, 
          "./my-dog.jpg": {
               "similarity" : 0.3208
          }
     },
     "A basketball.": {
          "https://upload.wikimedia.org/wikipedia/commons/7/7a/Basketball.png": {
               "similarity" : 0.3111
          },
           "./my-dog.jpg": {
               "similarity" : 0.2286
          }
     }
}

Where the first keys are the prompts, and the nested keys are the image urls/paths.

"similarity" is a float value indicating how similar the prompt is to that image.