Closed xenova closed 1 month ago
Example usage:
import { pipeline } from '@xenova/transformers'; // Create an image classification pipeline const classifier = await pipeline('image-classification', 'Xenova/fastvit_t12.apple_in1k', { quantized: false }); // Classify an image const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg'; const output = await classifier(url, { topk: 5 }); console.log(output); // [ // { label: 'tiger, Panthera tigris', score: 0.6649345755577087 }, // { label: 'tiger cat', score: 0.12454754114151001 }, // { label: 'lynx, catamount', score: 0.0010689536575227976 }, // { label: 'dhole, Cuon alpinus', score: 0.0010422508930787444 }, // { label: 'silky terrier, Sydney silky', score: 0.0009548701345920563 } // ]
List of supported models: https://huggingface.co/models?pipeline_tag=image-classification&library=transformers.js&other=fastvit&sort=trending
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Example usage:
List of supported models: https://huggingface.co/models?pipeline_tag=image-classification&library=transformers.js&other=fastvit&sort=trending