Views
No views yet
npm i @huggingface/transformersonnx-community/depth-anything-v2-small.1import { pipeline } from '@huggingface/transformers';
2
3// Create depth estimation pipeline
4const depth_estimator = await pipeline('depth-estimation', 'onnx-community/depth-anything-v2-small');
5
6// Predict depth of an image
7const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';
8const { depth } = await depth_estimator(url);
9
10// Visualize the output
11depth.save('depth.png');
onnx).