Prediction
lucataco/siglip:a39b979e4671e037ad90662ba6bd9377cbf0508083f2877b06e3f3850b8c8fa6Input
{
"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
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
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
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
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.
REPLICATE_API_TOKEN
environment variable:export 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.
brew install cog
If you don’t have Homebrew, there are other installation options available.
Run this to download the model and run it in your local environment:
cog predict r8.im/lucataco/siglip@sha256:a39b979e4671e037ad90662ba6bd9377cbf0508083f2877b06e3f3850b8c8fa6 \
-i 'image="https://replicate.delivery/pbxt/LbHQlTb3u5P9QgUPy2BfOVuVwYgX96cZmGaWrnJfLe76BfKm/image.png"' \
-i 'candidate_labels="red cube next to blue sphere, blue cube next to red sphere"'
To learn more, take a look at the Cog documentation.
Run this to download the model and run it in your local environment:
docker run -d -p 5000:5000 --gpus=all r8.im/lucataco/siglip@sha256:a39b979e4671e037ad90662ba6bd9377cbf0508083f2877b06e3f3850b8c8fa6
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "image": "https://replicate.delivery/pbxt/LbHQlTb3u5P9QgUPy2BfOVuVwYgX96cZmGaWrnJfLe76BfKm/image.png", "candidate_labels": "red cube next to blue sphere, blue cube next to red sphere" } }' \ http://localhost:5000/predictions
To learn more, take a look at the Cog documentation.
Output
{
"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"
}