typefile
{
"IMAGE": "https://replicate.delivery/pbxt/LqHPEWdCMqZep0OTxe60U4qCp9UNy6gABkaaTCuQRiyZx1qs/demo1.jpg",
"classes": "[armchair, blanket, lamp, carpet, couch, dog, floor, furniture, gray, green, living room, picture frame, pillow, plant, room, sit, stool, wood floor,door,wood]\n",
"target": "wall"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_E3J**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run remodela-ai/object-masks using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"remodela-ai/object-masks:42b836fe45018749f9b65b986b7e769b83bf06a44fbb47912eabb5c17a1865f4",
{
input: {
IMAGE: "https://replicate.delivery/pbxt/LqHPEWdCMqZep0OTxe60U4qCp9UNy6gABkaaTCuQRiyZx1qs/demo1.jpg",
classes: "[armchair, blanket, lamp, carpet, couch, dog, floor, furniture, gray, green, living room, picture frame, pillow, plant, room, sit, stool, wood floor,door,wood]\n",
target: "wall"
}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", 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_E3J**********************************
This is your API token. Keep it to yourself.
import replicate
Run remodela-ai/object-masks using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"remodela-ai/object-masks:42b836fe45018749f9b65b986b7e769b83bf06a44fbb47912eabb5c17a1865f4",
input={
"IMAGE": "https://replicate.delivery/pbxt/LqHPEWdCMqZep0OTxe60U4qCp9UNy6gABkaaTCuQRiyZx1qs/demo1.jpg",
"classes": "[armchair, blanket, lamp, carpet, couch, dog, floor, furniture, gray, green, living room, picture frame, pillow, plant, room, sit, stool, wood floor,door,wood]\n",
"target": "wall"
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_E3J**********************************
This is your API token. Keep it to yourself.
Run remodela-ai/object-masks 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": "remodela-ai/object-masks:42b836fe45018749f9b65b986b7e769b83bf06a44fbb47912eabb5c17a1865f4",
"input": {
"IMAGE": "https://replicate.delivery/pbxt/LqHPEWdCMqZep0OTxe60U4qCp9UNy6gABkaaTCuQRiyZx1qs/demo1.jpg",
"classes": "[armchair, blanket, lamp, carpet, couch, dog, floor, furniture, gray, green, living room, picture frame, pillow, plant, room, sit, stool, wood floor,door,wood]\\n",
"target": "wall"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "503a5ejj8hrgj0cjpvpb6p3h0w",
"model": "remodela-ai/object-masks",
"version": "42b836fe45018749f9b65b986b7e769b83bf06a44fbb47912eabb5c17a1865f4",
"input": {
"IMAGE": "https://replicate.delivery/pbxt/LqHPEWdCMqZep0OTxe60U4qCp9UNy6gABkaaTCuQRiyZx1qs/demo1.jpg",
"classes": "[armchair, blanket, lamp, carpet, couch, dog, floor, furniture, gray, green, living room, picture frame, pillow, plant, room, sit, stool, wood floor,door,wood]\n",
"target": "wall"
},
"logs": "trying to load grounding dino directly\nfinal text_encoder_type: bert-base-uncased",
"output": "https://replicate.delivery/pbxt/flqUIRKTg5xUHK1dpg0Bpc7et0w8GJ9Tl6wrOlCVjQfb3flOB/annotated_output_pillow.jpg",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-10-23T01:09:53.86Z",
"started_at": "2024-10-23T01:09:53.903426Z",
"completed_at": "2024-10-23T01:10:05.437268Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/503a5ejj8hrgj0cjpvpb6p3h0w/cancel",
"get": "https://api.replicate.com/v1/predictions/503a5ejj8hrgj0cjpvpb6p3h0w",
"web": "https://replicate.com/p/503a5ejj8hrgj0cjpvpb6p3h0w"
},
"metrics": {
"predict_time": 11.533842344,
"total_time": 11.577268
}
}
