Xenova HF staff commited on
Commit
b6705f5
·
verified ·
1 Parent(s): abd5c1d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +8 -8
README.md CHANGED
@@ -4,7 +4,7 @@ pipeline_tag: image-classification
4
  license: other
5
  ---
6
 
7
- https://huggingface.co/timm/fastvit_t8.apple_dist_in1k with ONNX weights to be compatible with Transformers.js.
8
 
9
  ## Usage (Transformers.js)
10
 
@@ -13,12 +13,12 @@ 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/fastvit_t8.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_t8.apple_dist_in1k', {
22
  quantized: false
23
  });
24
 
@@ -27,11 +27,11 @@ const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve
27
  const output = await classifier(url, { topk: 5 });
28
  console.log(output);
29
  // [
30
- // { label: 'tiger, Panthera tigris', score: 0.7876936197280884 },
31
- // { label: 'tiger cat', score: 0.08878856152296066 },
32
- // { label: 'zebra', score: 0.0008800383075140417 },
33
- // { label: 'Appenzeller', score: 0.0008539424743503332 },
34
- // { label: 'jaguar, panther, Panthera onca, Felis onca', score: 0.0008008014992810786 }
35
  // ]
36
  ```
37
 
 
4
  license: other
5
  ---
6
 
7
+ https://huggingface.co/timm/fastvit_t12.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_t12.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_t12.apple_dist_in1k', {
22
  quantized: false
23
  });
24
 
 
27
  const output = await classifier(url, { topk: 5 });
28
  console.log(output);
29
  // [
30
+ // { label: 'tiger, Panthera tigris', score: 0.7830049991607666 },
31
+ // { label: 'tiger cat', score: 0.08560094237327576 },
32
+ // { label: 'lynx, catamount', score: 0.0005580639117397368 },
33
+ // { label: 'Bernese mountain dog', score: 0.0005574578535743058 },
34
+ // { label: 'Appenzeller', score: 0.0005380114307627082 }
35
  // ]
36
  ```
37