typefile
{
"image_path": "https://replicate.delivery/pbxt/LmgW2RmcEBqwto8LgidrgAjqz0RF9CgbmxqXSV02Da1WKJfc/image.png"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Vks**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run chenxwh/ml-depth-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"chenxwh/ml-depth-pro:a6645b33f4e36eda0d8d52ab3da6ef37b82d198e2b70c72e680cc75f0baf1623",
{
input: {
image_path: "https://replicate.delivery/pbxt/LmgW2RmcEBqwto8LgidrgAjqz0RF9CgbmxqXSV02Da1WKJfc/image.png"
}
}
);
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_Vks**********************************
This is your API token. Keep it to yourself.
import replicate
Run chenxwh/ml-depth-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"chenxwh/ml-depth-pro:a6645b33f4e36eda0d8d52ab3da6ef37b82d198e2b70c72e680cc75f0baf1623",
input={
"image_path": "https://replicate.delivery/pbxt/LmgW2RmcEBqwto8LgidrgAjqz0RF9CgbmxqXSV02Da1WKJfc/image.png"
}
)
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_Vks**********************************
This is your API token. Keep it to yourself.
Run chenxwh/ml-depth-pro 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": "chenxwh/ml-depth-pro:a6645b33f4e36eda0d8d52ab3da6ef37b82d198e2b70c72e680cc75f0baf1623",
"input": {
"image_path": "https://replicate.delivery/pbxt/LmgW2RmcEBqwto8LgidrgAjqz0RF9CgbmxqXSV02Da1WKJfc/image.png"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Object output with 2 properties
{
"id": "2xdyf8zk09rgm0cjgb1st8v32c",
"model": "chenxwh/ml-depth-pro",
"version": "a6645b33f4e36eda0d8d52ab3da6ef37b82d198e2b70c72e680cc75f0baf1623",
"input": {
"image_path": "https://replicate.delivery/pbxt/LmgW2RmcEBqwto8LgidrgAjqz0RF9CgbmxqXSV02Da1WKJfc/image.png"
},
"logs": "Estimated focal length: 8410.98046875",
"output": {
"color_map": "https://replicate.delivery/pbxt/nfN8eze1m1JrKocq2LFD7KJg3G7XZ93ggdlpEE4x15kcoUMnA/out.jpg",
"npz": "https://replicate.delivery/pbxt/fCMuS0uOf1lnJkLiGikGojiNKMGD0Rx7zN6oiAKNCA4OUKmTA/out.npz"
},
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-10-12T22:05:32.802Z",
"started_at": "2024-10-12T22:07:08.601325Z",
"completed_at": "2024-10-12T22:07:11.014456Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/2xdyf8zk09rgm0cjgb1st8v32c/cancel",
"get": "https://api.replicate.com/v1/predictions/2xdyf8zk09rgm0cjgb1st8v32c",
"web": "https://replicate.com/p/2xdyf8zk09rgm0cjgb1st8v32c"
},
"metrics": {
"predict_time": 2.413130722,
"total_time": 98.212456
}
}
