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 dinov2 with registers #1110

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xenova
Copy link
Collaborator

@xenova xenova commented Dec 24, 2024

Added to transformers in huggingface/transformers#35348

Example usage:

import { pipeline } from '@huggingface/transformers';

// Create image classification pipeline
const classifier = await pipeline('image-classification', 'onnx-community/dinov2-with-registers-small-imagenet1k-1-layer');

// Classify an image
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';
const output = await classifier(url);
console.log(output);
// [
//   { label: 'tabby, tabby cat', score: 0.8135351538658142 },
//   { label: 'tiger cat', score: 0.08967583626508713 },
//   { label: 'Egyptian cat', score: 0.06800546497106552 },
//   { label: 'radiator', score: 0.003501888597384095 },
//   { label: 'quilt, comforter, comfort, puff', score: 0.003408448537811637 },
// ]

@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.

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