Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for FastViT #749

Merged
merged 2 commits into from
May 22, 2024
Merged

Add support for FastViT #749

merged 2 commits into from
May 22, 2024

Conversation

xenova
Copy link
Collaborator

@xenova xenova commented May 9, 2024

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

@HuggingFaceDocBuilderDev

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.

@xenova xenova merged commit e50f568 into main May 22, 2024
4 checks passed
@xenova xenova deleted the add-fastvit branch May 22, 2024 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants