typefile
{
"conf": 0.3,
"input_image": "https://replicate.delivery/pbxt/IklFY8BBmH3uU1kSooUnsglSh0UvNf4EsMTfrgK6K8R30gof/office.jpg",
"model_name": "yolox-s",
"nms": 0.3,
"return_json": false,
"tsize": 640
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_9wv**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run tofighi/yolox using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"tofighi/yolox:800b3b41c63f36b60c612e6e0512f886195151a0d9f71e2e89f4f77230e100a5",
{
input: {
conf: 0.3,
input_image: "https://replicate.delivery/pbxt/IklFY8BBmH3uU1kSooUnsglSh0UvNf4EsMTfrgK6K8R30gof/office.jpg",
model_name: "yolox-s",
nms: 0.3,
return_json: false,
tsize: 640
}
}
);
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_9wv**********************************
This is your API token. Keep it to yourself.
import replicate
Run tofighi/yolox using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"tofighi/yolox:800b3b41c63f36b60c612e6e0512f886195151a0d9f71e2e89f4f77230e100a5",
input={
"conf": 0.3,
"input_image": "https://replicate.delivery/pbxt/IklFY8BBmH3uU1kSooUnsglSh0UvNf4EsMTfrgK6K8R30gof/office.jpg",
"model_name": "yolox-s",
"nms": 0.3,
"return_json": False,
"tsize": 640
}
)
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_9wv**********************************
This is your API token. Keep it to yourself.
Run tofighi/yolox 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": "tofighi/yolox:800b3b41c63f36b60c612e6e0512f886195151a0d9f71e2e89f4f77230e100a5",
"input": {
"conf": 0.3,
"input_image": "https://replicate.delivery/pbxt/IklFY8BBmH3uU1kSooUnsglSh0UvNf4EsMTfrgK6K8R30gof/office.jpg",
"model_name": "yolox-s",
"nms": 0.3,
"return_json": false,
"tsize": 640
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Object output with 1 properties
{
"id": "cmwmqg4xhvfclkpjmtmb3wviqq",
"model": "tofighi/yolox",
"version": "800b3b41c63f36b60c612e6e0512f886195151a0d9f71e2e89f4f77230e100a5",
"input": {
"conf": 0.3,
"input_image": "https://replicate.delivery/pbxt/IklFY8BBmH3uU1kSooUnsglSh0UvNf4EsMTfrgK6K8R30gof/office.jpg",
"model_name": "yolox-s",
"nms": 0.3,
"return_json": false,
"tsize": 640
},
"logs": "2023-05-02 11:49:53.447 | INFO | tools.demo:inference:165 - Infer time: 0.0277s",
"output": {
"img": "https://replicate.delivery/pbxt/A7Y5xBCN8gYPGR5pfPdIbDmHIiBeDqvIP0M529visf6CXVvhA/outputs.png"
},
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-05-02T11:49:52.825442Z",
"started_at": "2023-05-02T11:49:52.880102Z",
"completed_at": "2023-05-02T11:49:54.190654Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/cmwmqg4xhvfclkpjmtmb3wviqq/cancel",
"get": "https://api.replicate.com/v1/predictions/cmwmqg4xhvfclkpjmtmb3wviqq"
},
"metrics": {
"predict_time": 1.310552,
"total_time": 1.365212
}
}
