Skip to content

Add support for ConvNeXT (V1+V2) models #428

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

Merged
merged 2 commits into from
Dec 2, 2023
Merged

Add support for ConvNeXT (V1+V2) models #428

merged 2 commits into from
Dec 2, 2023

Conversation

xenova
Copy link
Collaborator

@xenova xenova commented Dec 2, 2023

Example usage

  • ConvNeXT:
    import { pipeline } from '@xenova/transformers';
    
    // Create image classification pipeline
    const classifier = await pipeline('image-classification', 'Xenova/convnext-tiny-224');
    
    // Classify an image
    const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';
    const output = await classifier(url);
    console.log(output)
    // [{ label: 'tiger, Panthera tigris', score: 0.6153212785720825 }]
  • ConvNeXT V2:
    import { pipeline } from '@xenova/transformers';
    
    // Create image classification pipeline
    const classifier = await pipeline('image-classification', 'Xenova/convnextv2-femto-1k-224');
    
    // Classify an image
    const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';
    const output = await classifier(url);
    console.log(output)
    // [{ label: 'tiger, Panthera tigris', score: 0.5218687057495117 }]

Pre-converted models

@xenova xenova merged commit 6f05572 into main Dec 2, 2023
@xenova xenova deleted the add-convnext branch December 2, 2023 15:33
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.

1 participant