Update README.md
Browse files
README.md
CHANGED
@@ -12,7 +12,7 @@ If you haven't already, you can install the [Transformers.js](https://huggingfac
|
|
12 |
npm i @huggingface/transformers
|
13 |
```
|
14 |
|
15 |
-
**Example:**
|
16 |
|
17 |
```js
|
18 |
import { pipeline } from '@huggingface/transformers';
|
@@ -21,18 +21,18 @@ import { pipeline } from '@huggingface/transformers';
|
|
21 |
const segmenter = await pipeline('image-segmentation', 'onnx-community/maskformer-resnet101-cityscapes');
|
22 |
|
23 |
// Segment an image
|
24 |
-
const url = '
|
25 |
const output = await segmenter(url);
|
26 |
console.log(output)
|
27 |
// [
|
28 |
// {
|
29 |
-
// score: 0.
|
30 |
-
// label: '
|
31 |
// mask: RawImage { ... }
|
32 |
// },
|
33 |
// {
|
34 |
-
// score: 0.
|
35 |
-
// label: '
|
36 |
// mask: RawImage { ... }
|
37 |
// },
|
38 |
// ...
|
|
|
12 |
npm i @huggingface/transformers
|
13 |
```
|
14 |
|
15 |
+
**Example:** Image segmentation with `onnx-community/maskformer-resnet101-cityscapes`.
|
16 |
|
17 |
```js
|
18 |
import { pipeline } from '@huggingface/transformers';
|
|
|
21 |
const segmenter = await pipeline('image-segmentation', 'onnx-community/maskformer-resnet101-cityscapes');
|
22 |
|
23 |
// Segment an image
|
24 |
+
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cityscapes.png';
|
25 |
const output = await segmenter(url);
|
26 |
console.log(output)
|
27 |
// [
|
28 |
// {
|
29 |
+
// score: 0.9999792575836182,
|
30 |
+
// label: 'car',
|
31 |
// mask: RawImage { ... }
|
32 |
// },
|
33 |
// {
|
34 |
+
// score: 0.9999257326126099,
|
35 |
+
// label: 'traffic light',
|
36 |
// mask: RawImage { ... }
|
37 |
// },
|
38 |
// ...
|