Update README.md
Browse files
README.md
CHANGED
|
@@ -23,7 +23,6 @@ const depth_estimator = await pipeline('depth-estimation', 'onnx-community/depth
|
|
| 23 |
// Predict depth of an image
|
| 24 |
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';
|
| 25 |
const { predicted_depth, depth } = await depth_estimator(url);
|
| 26 |
-
depth.save('depth.png');
|
| 27 |
// {
|
| 28 |
// predicted_depth: Tensor {
|
| 29 |
// dims: [ 518, 686 ],
|
|
@@ -38,6 +37,9 @@ depth.save('depth.png');
|
|
| 38 |
// channels: 1
|
| 39 |
// }
|
| 40 |
// }
|
|
|
|
|
|
|
|
|
|
| 41 |
```
|
| 42 |
|
| 43 |

|
|
|
|
| 23 |
// Predict depth of an image
|
| 24 |
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';
|
| 25 |
const { predicted_depth, depth } = await depth_estimator(url);
|
|
|
|
| 26 |
// {
|
| 27 |
// predicted_depth: Tensor {
|
| 28 |
// dims: [ 518, 686 ],
|
|
|
|
| 37 |
// channels: 1
|
| 38 |
// }
|
| 39 |
// }
|
| 40 |
+
|
| 41 |
+
// Visualize the output
|
| 42 |
+
depth.save('depth.png');
|
| 43 |
```
|
| 44 |
|
| 45 |

|