typefile
{
"candidate_labels": "red cube next to blue sphere, blue cube next to red sphere",
"image": "https://replicate.delivery/pbxt/LbHQlTb3u5P9QgUPy2BfOVuVwYgX96cZmGaWrnJfLe76BfKm/image.png"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_a6o**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run lucataco/siglip using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"lucataco/siglip:a39b979e4671e037ad90662ba6bd9377cbf0508083f2877b06e3f3850b8c8fa6",
{
input: {
candidate_labels: "red cube next to blue sphere, blue cube next to red sphere",
image: "https://replicate.delivery/pbxt/LbHQlTb3u5P9QgUPy2BfOVuVwYgX96cZmGaWrnJfLe76BfKm/image.png"
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_a6o**********************************
This is your API token. Keep it to yourself.
import replicate
Run lucataco/siglip using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"lucataco/siglip:a39b979e4671e037ad90662ba6bd9377cbf0508083f2877b06e3f3850b8c8fa6",
input={
"candidate_labels": "red cube next to blue sphere, blue cube next to red sphere",
"image": "https://replicate.delivery/pbxt/LbHQlTb3u5P9QgUPy2BfOVuVwYgX96cZmGaWrnJfLe76BfKm/image.png"
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_a6o**********************************
This is your API token. Keep it to yourself.
Run lucataco/siglip using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "lucataco/siglip:a39b979e4671e037ad90662ba6bd9377cbf0508083f2877b06e3f3850b8c8fa6",
"input": {
"candidate_labels": "red cube next to blue sphere, blue cube next to red sphere",
"image": "https://replicate.delivery/pbxt/LbHQlTb3u5P9QgUPy2BfOVuVwYgX96cZmGaWrnJfLe76BfKm/image.png"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
[{'score': 1.0, 'label': ' blue cube next to red sphere'}, {'score': 1.0, 'label': 'red cube next to blue sphere'}]{
"id": "ds46zcwrzdrg80chvn6rgkqzcw",
"model": "lucataco/siglip",
"version": "a39b979e4671e037ad90662ba6bd9377cbf0508083f2877b06e3f3850b8c8fa6",
"input": {
"candidate_labels": "red cube next to blue sphere, blue cube next to red sphere",
"image": "https://replicate.delivery/pbxt/LbHQlTb3u5P9QgUPy2BfOVuVwYgX96cZmGaWrnJfLe76BfKm/image.png"
},
"logs": "",
"output": "[{'score': 1.0, 'label': ' blue cube next to red sphere'}, {'score': 1.0, 'label': 'red cube next to blue sphere'}]",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-09-10T18:58:55.867Z",
"started_at": "2024-09-10T19:00:09.841889Z",
"completed_at": "2024-09-10T19:00:10.853139Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/ds46zcwrzdrg80chvn6rgkqzcw/cancel",
"get": "https://api.replicate.com/v1/predictions/ds46zcwrzdrg80chvn6rgkqzcw",
"web": "https://replicate.com/p/ds46zcwrzdrg80chvn6rgkqzcw"
},
"metrics": {
"predict_time": 1.011249709,
"total_time": 74.986139
}
}