Skip to main content

Basic usage

Send an image URL and a set of candidate labels to detect objects in the image
import Bytez from 'bytez.js';

// insert your key
const sdk = new Bytez('BYTEZ_KEY');

// choose your model
const model = sdk.model('google/owlv2-base-patch16-finetuned');

// provide the model with input
const input = {
  "url": "https://ocean.si.edu/sites/default/files/styles/3_2_largest/public/2023-11/Screen_Shot_2018-04-16_at_1_42_56_PM.png.webp?itok=Icvi-ek9",
  "candidate_labels": [
    "squid",
    "octopus",
    "human",
    "cat"
  ]
};

// send to the model
const { error, output } = await model.run(input);

// observe the output
console.log({ error, output });