Prediction
lucataco/siglip:a39b979eInput
{
"image": "https://replicate.delivery/pbxt/LbHQlTb3u5P9QgUPy2BfOVuVwYgX96cZmGaWrnJfLe76BfKm/image.png",
"candidate_labels": "red cube next to blue sphere, blue cube next to red sphere"
}
npm install replicate
Set the
REPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the client
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: {
image: "https://replicate.delivery/pbxt/LbHQlTb3u5P9QgUPy2BfOVuVwYgX96cZmGaWrnJfLe76BfKm/image.png",
candidate_labels: "red cube next to blue sphere, blue cube next to red sphere"
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
Set the
REPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the client
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={
"image": "https://replicate.delivery/pbxt/LbHQlTb3u5P9QgUPy2BfOVuVwYgX96cZmGaWrnJfLe76BfKm/image.png",
"candidate_labels": "red cube next to blue sphere, blue cube next to red sphere"
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
Set the
REPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
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": "a39b979e4671e037ad90662ba6bd9377cbf0508083f2877b06e3f3850b8c8fa6",
"input": {
"image": "https://replicate.delivery/pbxt/LbHQlTb3u5P9QgUPy2BfOVuVwYgX96cZmGaWrnJfLe76BfKm/image.png",
"candidate_labels": "red cube next to blue sphere, blue cube next to red sphere"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
[{'score': 1.0, 'label': ' blue cube next to red sphere'}, {'score': 1.0, 'label': 'red cube next to blue sphere'}]
{
"completed_at": "2024-09-10T19:00:10.853139Z",
"created_at": "2024-09-10T18:58:55.867000Z",
"data_removed": false,
"error": null,
"id": "ds46zcwrzdrg80chvn6rgkqzcw",
"input": {
"image": "https://replicate.delivery/pbxt/LbHQlTb3u5P9QgUPy2BfOVuVwYgX96cZmGaWrnJfLe76BfKm/image.png",
"candidate_labels": "red cube next to blue sphere, blue cube next to red sphere"
},
"logs": null,
"metrics": {
"predict_time": 1.011249709,
"total_time": 74.986139
},
"output": "[{'score': 1.0, 'label': ' blue cube next to red sphere'}, {'score': 1.0, 'label': 'red cube next to blue sphere'}]",
"started_at": "2024-09-10T19:00:09.841889Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/ds46zcwrzdrg80chvn6rgkqzcw",
"cancel": "https://api.replicate.com/v1/predictions/ds46zcwrzdrg80chvn6rgkqzcw/cancel"
},
"version": "a39b979e4671e037ad90662ba6bd9377cbf0508083f2877b06e3f3850b8c8fa6"
}
Generated in