typefile
{
"image": "https://replicate.delivery/pbxt/Iq6u39HlpVeYwhM3hzWBfbOCVKJJ2LENzNC1ccXrw5SUYAaC/bunny3.webp",
"score_character_threshold": 0.85,
"score_general_threshold": 0.35
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_XsF**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run pengdaqian2020/image-tagger using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"pengdaqian2020/image-tagger:5a3e65f223fe2291679a6c3c812ddb278aa6d43bbcf118c09530b4309aaac00e",
{
input: {
image: "https://replicate.delivery/pbxt/Iq6u39HlpVeYwhM3hzWBfbOCVKJJ2LENzNC1ccXrw5SUYAaC/bunny3.webp",
score_character_threshold: 0.85,
score_general_threshold: 0.35
}
}
);
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_XsF**********************************
This is your API token. Keep it to yourself.
import replicate
Run pengdaqian2020/image-tagger using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"pengdaqian2020/image-tagger:5a3e65f223fe2291679a6c3c812ddb278aa6d43bbcf118c09530b4309aaac00e",
input={
"image": "https://replicate.delivery/pbxt/Iq6u39HlpVeYwhM3hzWBfbOCVKJJ2LENzNC1ccXrw5SUYAaC/bunny3.webp",
"score_character_threshold": 0.85,
"score_general_threshold": 0.35
}
)
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_XsF**********************************
This is your API token. Keep it to yourself.
Run pengdaqian2020/image-tagger 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": "pengdaqian2020/image-tagger:5a3e65f223fe2291679a6c3c812ddb278aa6d43bbcf118c09530b4309aaac00e",
"input": {
"image": "https://replicate.delivery/pbxt/Iq6u39HlpVeYwhM3hzWBfbOCVKJJ2LENzNC1ccXrw5SUYAaC/bunny3.webp",
"score_character_threshold": 0.85,
"score_general_threshold": 0.35
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "nieeiduiobcsfcbhanidof2nb4",
"model": "pengdaqian2020/image-tagger",
"version": "5a3e65f223fe2291679a6c3c812ddb278aa6d43bbcf118c09530b4309aaac00e",
"input": {
"image": "https://replicate.delivery/pbxt/Iq6u39HlpVeYwhM3hzWBfbOCVKJJ2LENzNC1ccXrw5SUYAaC/bunny3.webp",
"score_character_threshold": 0.85,
"score_general_threshold": 0.35
},
"logs": "",
"output": [
{
"confidence": 0.8186014890670776,
"tag": "blurry"
},
{
"confidence": 0.9389649629592896,
"tag": "no_humans"
},
{
"confidence": 0.5496093034744263,
"tag": "depth_of_field"
},
{
"confidence": 0.8239761590957642,
"tag": "animal"
},
{
"confidence": 0.608523964881897,
"tag": "cat"
},
{
"confidence": 0.4221939146518707,
"tag": "rabbit"
},
{
"confidence": 0.7589364647865295,
"tag": "realistic"
},
{
"confidence": 0.911034345626831,
"tag": "animal_focus"
}
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-05-17T13:30:54.918922Z",
"started_at": "2023-05-17T13:30:54.959324Z",
"completed_at": "2023-05-17T13:30:56.395592Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/nieeiduiobcsfcbhanidof2nb4/cancel",
"get": "https://api.replicate.com/v1/predictions/nieeiduiobcsfcbhanidof2nb4"
},
"metrics": {
"predict_time": 1.436268,
"total_time": 1.47667
}
}