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.
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 c-barron/owl-sam using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"c-barron/owl-sam:08ab1904032ff1e79e9088d3b7fb4e42eebefa13c43f0f360446db31b1e88520",
{
input: {
image: "https://st.mngbcn.com/rcs/pics/static/T5/fotos/outfit/S20/57034757_56-99999999_01.jpg",
prompts: ["shoes","pants"],
threshold: 0.15
}
}
);
// To access the file URL:
console.log(output[0].url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output[0]);
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 c-barron/owl-sam using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"c-barron/owl-sam:08ab1904032ff1e79e9088d3b7fb4e42eebefa13c43f0f360446db31b1e88520",
input={
"image": "https://st.mngbcn.com/rcs/pics/static/T5/fotos/outfit/S20/57034757_56-99999999_01.jpg",
"prompts": ["shoes","pants"],
"threshold": 0.15
}
)
# The c-barron/owl-sam model can stream output as it's running.
# The predict method returns an iterator, and you can iterate over that output.
for item in output:
# https://replicate.com/c-barron/owl-sam/api#output-schema
print(item)
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 c-barron/owl-sam 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": "c-barron/owl-sam:08ab1904032ff1e79e9088d3b7fb4e42eebefa13c43f0f360446db31b1e88520",
"input": {
"image": "https://st.mngbcn.com/rcs/pics/static/T5/fotos/outfit/S20/57034757_56-99999999_01.jpg",
"prompts": ["shoes","pants"],
"threshold": 0.15
}
}' \
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": "2024-05-31T02:41:37.188941Z",
"created_at": "2024-05-31T02:40:20.831000Z",
"data_removed": false,
"error": null,
"id": "k2hp2a05bxrgm0cfsj2sxbt07r",
"input": {
"image": "https://st.mngbcn.com/rcs/pics/static/T5/fotos/outfit/S20/57034757_56-99999999_01.jpg",
"prompts": [
"shoes",
"pants"
],
"threshold": 0.15
},
"logs": "Running prediction: 49b77bce-83cb-4bd6-b833-076341ae249b...\n/tmp/tmpc109jy1o57034757_56-99999999_01.jpg\nLoading Image\nLoading Image\nRunning Detection\nPrompts: ['shoes', 'pants']\nThreshold: 0.15\n(1500, 2098)\n[DetectionResult(score=0.3914962112903595, label='pants', box=BoundingBox(xmin=535, ymin=940, xmax=943, ymax=1867), mask=None), DetectionResult(score=0.19421137869358063, label='shoes', box=BoundingBox(xmin=801, ymin=1872, xmax=992, ymax=2037), mask=None), DetectionResult(score=0.19201648235321045, label='shoes', box=BoundingBox(xmin=584, ymin=1856, xmax=752, ymax=2019), mask=None)]\nRunning Segmentation\nArray min: 0, Array max: 255\nArray min: 0, Array max: 255\nDone!\nConverting image to RGB\nConverting image to RGB",
"metrics": {
"predict_time": 9.797434,
"total_time": 76.357941
},
"output": [
"https://replicate.delivery/pbxt/VCx60glJf6UEEiA9IiefiYzJuFFxSRxKW4BhK1IMFh9BXdzlA/shoes.jpg",
"https://replicate.delivery/pbxt/x3SQzinjQs5fZCDvXaq03zeDqrEp51sBd9qeJqLD8ePBu6mLB/pants.jpg"
],
"started_at": "2024-05-31T02:41:27.391507Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/k2hp2a05bxrgm0cfsj2sxbt07r",
"cancel": "https://api.replicate.com/v1/predictions/k2hp2a05bxrgm0cfsj2sxbt07r/cancel"
},
"version": "08ab1904032ff1e79e9088d3b7fb4e42eebefa13c43f0f360446db31b1e88520"
}
Running prediction: 49b77bce-83cb-4bd6-b833-076341ae249b...
/tmp/tmpc109jy1o57034757_56-99999999_01.jpg
Loading Image
Loading Image
Running Detection
Prompts: ['shoes', 'pants']
Threshold: 0.15
(1500, 2098)
[DetectionResult(score=0.3914962112903595, label='pants', box=BoundingBox(xmin=535, ymin=940, xmax=943, ymax=1867), mask=None), DetectionResult(score=0.19421137869358063, label='shoes', box=BoundingBox(xmin=801, ymin=1872, xmax=992, ymax=2037), mask=None), DetectionResult(score=0.19201648235321045, label='shoes', box=BoundingBox(xmin=584, ymin=1856, xmax=752, ymax=2019), mask=None)]
Running Segmentation
Array min: 0, Array max: 255
Array min: 0, Array max: 255
Done!
Converting image to RGB
Converting image to RGB