Failed to load versions. Head to the versions page to see all versions for this model.
You're looking at a specific version of this model. Jump to the model overview.
casia-iva-lab /fastsam:371aeee1
Input
Run this model in Node.js with one line of code:
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 casia-iva-lab/fastsam using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"casia-iva-lab/fastsam:371aeee1ce0c5efd25bbef7a4527ec9e59188b963ebae1eeb851ddc145685c17",
{
input: {
iou: 0.9,
conf: 0.4,
retina: true,
box_prompt: "[0,0,0,0]",
image_size: 640,
model_name: "FastSAM-x",
input_image: "https://replicate.delivery/pbxt/J45qcllCGZNBhg0bwAPYDSqIf0Cp1Yh0VucBg5K7caiDW2D4/sa_1309.jpg",
point_label: "[0]",
point_prompt: "[[0,0]]",
withContours: true,
better_quality: true
}
}
);
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 casia-iva-lab/fastsam using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"casia-iva-lab/fastsam:371aeee1ce0c5efd25bbef7a4527ec9e59188b963ebae1eeb851ddc145685c17",
input={
"iou": 0.9,
"conf": 0.4,
"retina": True,
"box_prompt": "[0,0,0,0]",
"image_size": 640,
"model_name": "FastSAM-x",
"input_image": "https://replicate.delivery/pbxt/J45qcllCGZNBhg0bwAPYDSqIf0Cp1Yh0VucBg5K7caiDW2D4/sa_1309.jpg",
"point_label": "[0]",
"point_prompt": "[[0,0]]",
"withContours": True,
"better_quality": True
}
)
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 casia-iva-lab/fastsam 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": "371aeee1ce0c5efd25bbef7a4527ec9e59188b963ebae1eeb851ddc145685c17",
"input": {
"iou": 0.9,
"conf": 0.4,
"retina": true,
"box_prompt": "[0,0,0,0]",
"image_size": 640,
"model_name": "FastSAM-x",
"input_image": "https://replicate.delivery/pbxt/J45qcllCGZNBhg0bwAPYDSqIf0Cp1Yh0VucBg5K7caiDW2D4/sa_1309.jpg",
"point_label": "[0]",
"point_prompt": "[[0,0]]",
"withContours": true,
"better_quality": true
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Add a payment method to run this model.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2023-06-30T16:56:00.519076Z",
"created_at": "2023-06-30T16:55:54.254157Z",
"data_removed": false,
"error": null,
"id": "afyxdejbtz57g7xjkld7fdttqa",
"input": {
"iou": 0.9,
"conf": 0.4,
"retina": true,
"box_prompt": "[0,0,0,0]",
"image_size": 640,
"model_name": "FastSAM-x",
"input_image": "https://replicate.delivery/pbxt/J45qcllCGZNBhg0bwAPYDSqIf0Cp1Yh0VucBg5K7caiDW2D4/sa_1309.jpg",
"point_label": "[0]",
"point_prompt": "[[0,0]]",
"withContours": true,
"better_quality": true
},
"logs": "image 1/1 /tmp/tmp0bowo8issa_1309.jpg: 448x640 30 objects, 91.7ms\nSpeed: 3.4ms preprocess, 91.7ms inference, 18.5ms postprocess per image at shape (1, 3, 640, 640)",
"metrics": {
"predict_time": 6.29792,
"total_time": 6.264919
},
"output": "https://replicate.delivery/pbxt/Fj5V1f6pWOQPISwBq3sjtvaENfkfffkUmfrTR9Vy8fbmP2llIA/tmp.out.png",
"started_at": "2023-06-30T16:55:54.221156Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/afyxdejbtz57g7xjkld7fdttqa",
"cancel": "https://api.replicate.com/v1/predictions/afyxdejbtz57g7xjkld7fdttqa/cancel"
},
"version": "371aeee1ce0c5efd25bbef7a4527ec9e59188b963ebae1eeb851ddc145685c17"
}
image 1/1 /tmp/tmp0bowo8issa_1309.jpg: 448x640 30 objects, 91.7ms
Speed: 3.4ms preprocess, 91.7ms inference, 18.5ms postprocess per image at shape (1, 3, 640, 640)