Update README.md
Browse files
README.md
CHANGED
@@ -4,7 +4,7 @@ pipeline_tag: image-classification
|
|
4 |
license: other
|
5 |
---
|
6 |
|
7 |
-
https://huggingface.co/timm/
|
8 |
|
9 |
## Usage (Transformers.js)
|
10 |
|
@@ -13,25 +13,23 @@ If you haven't already, you can install the [Transformers.js](https://huggingfac
|
|
13 |
npm i @xenova/transformers
|
14 |
```
|
15 |
|
16 |
-
**Example:** Perform image classification with `Xenova/
|
17 |
```js
|
18 |
import { pipeline } from '@xenova/transformers';
|
19 |
|
20 |
// Create an image classification pipeline
|
21 |
-
const classifier = await pipeline('image-classification', 'Xenova/
|
22 |
-
quantized: false
|
23 |
-
});
|
24 |
|
25 |
// Classify an image
|
26 |
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';
|
27 |
const output = await classifier(url, { topk: 5 });
|
28 |
console.log(output);
|
29 |
// [
|
30 |
-
// { label: 'tiger, Panthera tigris', score: 0.
|
31 |
-
// { label: 'tiger cat', score: 0.
|
32 |
-
// { label: '
|
33 |
-
// { label: '
|
34 |
-
// { label: '
|
35 |
// ]
|
36 |
```
|
37 |
|
|
|
4 |
license: other
|
5 |
---
|
6 |
|
7 |
+
https://huggingface.co/timm/fastvit_ma36.apple_dist_in1k with ONNX weights to be compatible with Transformers.js.
|
8 |
|
9 |
## Usage (Transformers.js)
|
10 |
|
|
|
13 |
npm i @xenova/transformers
|
14 |
```
|
15 |
|
16 |
+
**Example:** Perform image classification with `Xenova/fastvit_ma36.apple_dist_in1k`.
|
17 |
```js
|
18 |
import { pipeline } from '@xenova/transformers';
|
19 |
|
20 |
// Create an image classification pipeline
|
21 |
+
const classifier = await pipeline('image-classification', 'Xenova/fastvit_ma36.apple_dist_in1k');
|
|
|
|
|
22 |
|
23 |
// Classify an image
|
24 |
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';
|
25 |
const output = await classifier(url, { topk: 5 });
|
26 |
console.log(output);
|
27 |
// [
|
28 |
+
// { label: 'tiger, Panthera tigris', score: 0.821342945098877 },
|
29 |
+
// { label: 'tiger cat', score: 0.03833380341529846 },
|
30 |
+
// { label: 'lynx, catamount', score: 0.0009026902262121439 },
|
31 |
+
// { label: 'jaguar, panther, Panthera onca, Felis onca', score: 0.0008144468883983791 },
|
32 |
+
// { label: 'dhole, Cuon alpinus', score: 0.0006418420816771686 }
|
33 |
// ]
|
34 |
```
|
35 |
|