cjwbw
/
depth-anything
Highly practical solution for robust monocular depth estimation by training on a combination of 1.5M labeled images and 62M+ unlabeled images
Run cjwbw/depth-anything with an API
Use one of our client libraries to get started quickly.
Set the REPLICATE_API_TOKEN
environment variable
export REPLICATE_API_TOKEN=<paste-your-token-here>
Learn more about authentication
Install Replicate’s Node.js client library
npm install replicate
Run cjwbw/depth-anything using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
import Replicate from "replicate";
const replicate = new Replicate();
const input = {
image: "https://replicate.delivery/pbxt/KHNQeXAurKvjfdelBdvQcJ0l2Q0a7hRgoyLuNPc2Q9w7zQL7/IMG_0639.png"
};
const output = await replicate.run("cjwbw/depth-anything:e5b0454205013708df48492a13a8ee4b3c412173362fc56c6b5558eb54e527e5", { input });
import { writeFile } from "node:fs/promises";
await writeFile("output.png", output);
//=> output.png written to disk