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/J45tzbTDdnrUx5C81t4MieMlBNjSYQ2jWiqjM6LDx0oH2NMb/download%20%281%29.jpeg",
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/J45tzbTDdnrUx5C81t4MieMlBNjSYQ2jWiqjM6LDx0oH2NMb/download%20%281%29.jpeg",
"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/J45tzbTDdnrUx5C81t4MieMlBNjSYQ2jWiqjM6LDx0oH2NMb/download%20%281%29.jpeg",
"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:57:01.306121Z",
"created_at": "2023-06-30T16:56:46.596393Z",
"data_removed": false,
"error": null,
"id": "bqwn2ojb55kbdonx6pfzizlezq",
"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/J45tzbTDdnrUx5C81t4MieMlBNjSYQ2jWiqjM6LDx0oH2NMb/download%20%281%29.jpeg",
"point_label": "[0]",
"point_prompt": "[[0,0]]",
"withContours": true,
"better_quality": true
},
"logs": "image 1/1 /tmp/tmp36n3ga2jdownload%20(1).jpeg: 448x640 91 objects, 89.8ms\nSpeed: 3.4ms preprocess, 89.8ms inference, 48.8ms postprocess per image at shape (1, 3, 640, 640)",
"metrics": {
"predict_time": 14.766861,
"total_time": 14.709728
},
"output": "https://replicate.delivery/pbxt/2VwnaTqmiwZOIZ4J6TlfgLTQJ7Z4QytCfaIiWswPrfx4aXWiA/tmp.out.png",
"started_at": "2023-06-30T16:56:46.539260Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/bqwn2ojb55kbdonx6pfzizlezq",
"cancel": "https://api.replicate.com/v1/predictions/bqwn2ojb55kbdonx6pfzizlezq/cancel"
},
"version": "371aeee1ce0c5efd25bbef7a4527ec9e59188b963ebae1eeb851ddc145685c17"
}
image 1/1 /tmp/tmp36n3ga2jdownload%20(1).jpeg: 448x640 91 objects, 89.8ms
Speed: 3.4ms preprocess, 89.8ms inference, 48.8ms postprocess per image at shape (1, 3, 640, 640)