typefile
{
"image_path": "https://replicate.delivery/pbxt/K5AgrRIooaVJzQBgkNhh4c8nOFDZauLY70kZyIt3FRdwx9Qw/image_4.jpg",
"ref_measure": "height",
"ref_object": "obj 2",
"ref_pattern": 60,
"select_option": 0
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_eME**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run remodela-ai/scaling-model-v1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"remodela-ai/scaling-model-v1:85d9b712e93a86a30b60900fdf23dae1f7ef5836ba102ed26f65c3ed966f2595",
{
input: {
image_path: "https://replicate.delivery/pbxt/K5AgrRIooaVJzQBgkNhh4c8nOFDZauLY70kZyIt3FRdwx9Qw/image_4.jpg",
ref_measure: "height",
ref_object: "obj 2",
ref_pattern: 60,
select_option: 0
}
}
);
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_eME**********************************
This is your API token. Keep it to yourself.
import replicate
Run remodela-ai/scaling-model-v1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"remodela-ai/scaling-model-v1:85d9b712e93a86a30b60900fdf23dae1f7ef5836ba102ed26f65c3ed966f2595",
input={
"image_path": "https://replicate.delivery/pbxt/K5AgrRIooaVJzQBgkNhh4c8nOFDZauLY70kZyIt3FRdwx9Qw/image_4.jpg",
"ref_measure": "height",
"ref_object": "obj 2",
"ref_pattern": 60,
"select_option": 0
}
)
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_eME**********************************
This is your API token. Keep it to yourself.
Run remodela-ai/scaling-model-v1 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/scaling-model-v1:85d9b712e93a86a30b60900fdf23dae1f7ef5836ba102ed26f65c3ed966f2595",
"input": {
"image_path": "https://replicate.delivery/pbxt/K5AgrRIooaVJzQBgkNhh4c8nOFDZauLY70kZyIt3FRdwx9Qw/image_4.jpg",
"ref_measure": "height",
"ref_object": "obj 2",
"ref_pattern": 60,
"select_option": 0
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "btugqsbbrifl2hl65tkjf6clxi",
"model": "remodela-ai/scaling-model-v1",
"version": "85d9b712e93a86a30b60900fdf23dae1f7ef5836ba102ed26f65c3ed966f2595",
"input": {
"image_path": "https://replicate.delivery/pbxt/K5AgrRIooaVJzQBgkNhh4c8nOFDZauLY70kZyIt3FRdwx9Qw/image_4.jpg",
"ref_measure": "height",
"ref_object": "obj 2",
"ref_pattern": 60,
"select_option": 0
},
"logs": "",
"output": [
"Scaling of spaces in centimetres: ",
{
"obj 1": {
"area": 1782.084,
"height": 44.467,
"perimeter": 169.087,
"width": 40.077
},
"obj 2": {
"area": 4051.516,
"height": 59.996,
"perimeter": 255.051,
"width": 67.529
}
}
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-12-20T15:55:14.571393Z",
"started_at": "2023-12-20T15:55:14.763387Z",
"completed_at": "2023-12-20T15:55:20.290999Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/btugqsbbrifl2hl65tkjf6clxi/cancel",
"get": "https://api.replicate.com/v1/predictions/btugqsbbrifl2hl65tkjf6clxi"
},
"metrics": {
"predict_time": 5.527612,
"total_time": 5.719606
}
}