typefile
{
"conf": 0.1,
"image": "https://replicate.delivery/pbxt/LsYcS4CS8wu8axvCa5K8aIkZoF6CeSrjytmJXbPdDeIMVmmp/IMG_0169.JPG",
"iou": 0.45
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_PN9**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run bencevans/megadetector-v5a using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"bencevans/megadetector-v5a:cd30d71e39a456a2b43580b03c199bb305200e7c62b0054d8c9014c4e11e7259",
{
input: {
conf: 0.1,
image: "https://replicate.delivery/pbxt/LsYcS4CS8wu8axvCa5K8aIkZoF6CeSrjytmJXbPdDeIMVmmp/IMG_0169.JPG",
iou: 0.45
}
}
);
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_PN9**********************************
This is your API token. Keep it to yourself.
import replicate
Run bencevans/megadetector-v5a using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"bencevans/megadetector-v5a:cd30d71e39a456a2b43580b03c199bb305200e7c62b0054d8c9014c4e11e7259",
input={
"conf": 0.1,
"image": "https://replicate.delivery/pbxt/LsYcS4CS8wu8axvCa5K8aIkZoF6CeSrjytmJXbPdDeIMVmmp/IMG_0169.JPG",
"iou": 0.45
}
)
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_PN9**********************************
This is your API token. Keep it to yourself.
Run bencevans/megadetector-v5a 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": "bencevans/megadetector-v5a:cd30d71e39a456a2b43580b03c199bb305200e7c62b0054d8c9014c4e11e7259",
"input": {
"conf": 0.1,
"image": "https://replicate.delivery/pbxt/LsYcS4CS8wu8axvCa5K8aIkZoF6CeSrjytmJXbPdDeIMVmmp/IMG_0169.JPG",
"iou": 0.45
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "v778j3y941rgc0cjtzvrjk3at0",
"model": "bencevans/megadetector-v5a",
"version": "cd30d71e39a456a2b43580b03c199bb305200e7c62b0054d8c9014c4e11e7259",
"input": {
"conf": 0.1,
"image": "https://replicate.delivery/pbxt/LsYcS4CS8wu8axvCa5K8aIkZoF6CeSrjytmJXbPdDeIMVmmp/IMG_0169.JPG",
"iou": 0.45
},
"logs": "Running prediction at 2024-10-29 11:13:10.854067\nConfidence threshold: 0.1\nIOU threshold: 0.45\nLoading image from /tmp/tmpjvmfi4jjIMG_0169.JPG\nRunning model\n[[0.5012515783309937, 0.28547045588493347, 0.18905991315841675, 0.21567268669605255, 0.9230549335479736, 0.0], [0.6425034403800964, 0.871682345867157, 0.655266523361206, 0.20228195190429688, 0.41477158665657043, 0.0]]\nFound 2 objects\nPrediction took 0:00:00.348228",
"output": [
{
"bbox": [
0.5012515783309937,
0.28547045588493347,
0.18905991315841675,
0.21567268669605255
],
"category": 1,
"conf": 0.9230549335479736
},
{
"bbox": [
0.6425034403800964,
0.871682345867157,
0.655266523361206,
0.20228195190429688
],
"category": 1,
"conf": 0.41477158665657043
}
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-10-29T11:09:53.312Z",
"started_at": "2024-10-29T11:13:10.541174Z",
"completed_at": "2024-10-29T11:13:11.218426Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/v778j3y941rgc0cjtzvrjk3at0/cancel",
"get": "https://api.replicate.com/v1/predictions/v778j3y941rgc0cjtzvrjk3at0",
"web": "https://replicate.com/p/v778j3y941rgc0cjtzvrjk3at0"
},
"metrics": {
"predict_time": 0.677252397,
"total_time": 197.906426
}
}