Add/update the quantized ONNX model files and README.md for Transformers.js v3 (#1)
Browse files- Add/update the quantized ONNX model files and README.md for Transformers.js v3 (c748206a432f48fa832f86d237a15b4e3c6b8a96)
Co-authored-by: Yuichiro Tachibana <[email protected]>
README.md
CHANGED
@@ -8,15 +8,15 @@ https://huggingface.co/nvidia/segformer-b2-finetuned-cityscapes-1024-1024 with O
|
|
8 |
|
9 |
## Usage (Transformers.js)
|
10 |
|
11 |
-
If you haven't already, you can install the [Transformers.js](https://huggingface.co/docs/transformers.js) JavaScript library from [NPM](https://www.npmjs.com/package/@
|
12 |
```bash
|
13 |
-
npm i @
|
14 |
```
|
15 |
|
16 |
**Example:** Image segmentation with `Xenova/segformer-b2-finetuned-cityscapes-1024-1024`.
|
17 |
|
18 |
```js
|
19 |
-
import { pipeline } from '@
|
20 |
|
21 |
// Create an image segmentation pipeline
|
22 |
const segmenter = await pipeline('image-segmentation', 'Xenova/segformer-b2-finetuned-cityscapes-1024-1024');
|
@@ -24,7 +24,7 @@ const segmenter = await pipeline('image-segmentation', 'Xenova/segformer-b2-fine
|
|
24 |
// Segment an image
|
25 |
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cityscapes.png';
|
26 |
const output = await segmenter(url);
|
27 |
-
console.log(output)
|
28 |
// [
|
29 |
// {
|
30 |
// score: null,
|
|
|
8 |
|
9 |
## Usage (Transformers.js)
|
10 |
|
11 |
+
If you haven't already, you can install the [Transformers.js](https://huggingface.co/docs/transformers.js) JavaScript library from [NPM](https://www.npmjs.com/package/@huggingface/transformers) using:
|
12 |
```bash
|
13 |
+
npm i @huggingface/transformers
|
14 |
```
|
15 |
|
16 |
**Example:** Image segmentation with `Xenova/segformer-b2-finetuned-cityscapes-1024-1024`.
|
17 |
|
18 |
```js
|
19 |
+
import { pipeline } from '@huggingface/transformers';
|
20 |
|
21 |
// Create an image segmentation pipeline
|
22 |
const segmenter = await pipeline('image-segmentation', 'Xenova/segformer-b2-finetuned-cityscapes-1024-1024');
|
|
|
24 |
// Segment an image
|
25 |
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cityscapes.png';
|
26 |
const output = await segmenter(url);
|
27 |
+
console.log(output);
|
28 |
// [
|
29 |
// {
|
30 |
// score: null,
|