Views
No views yet
npm i @huggingface/transformersXenova/fastvit_sa24.apple_dist_in1k.1import { pipeline } from '@huggingface/transformers';
2
3// Create an image classification pipeline
4const classifier = await pipeline('image-classification', 'Xenova/fastvit_sa24.apple_dist_in1k');
5
6// Classify an image
7const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';
8const output = await classifier(url, { top_k: 5 });
9console.log(output);
10// [
11// { label: 'tiger, Panthera tigris', score: 0.6914318203926086 },
12// { label: 'tiger cat', score: 0.051140956580638885 },
13// { label: 'shower curtain', score: 0.04092452675104141 },
14// { label: 'apron', score: 0.004144148901104927 },
15// { label: 'pillow', score: 0.003142605535686016 }
16// ]onnx).