Instructions to use timm/vit_base_patch14_dinov2.lvd142m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- timm
How to use timm/vit_base_patch14_dinov2.lvd142m with timm:
import timm model = timm.create_model("hf_hub:timm/vit_base_patch14_dinov2.lvd142m", pretrained=True) - Transformers
How to use timm/vit_base_patch14_dinov2.lvd142m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-feature-extraction", model="timm/vit_base_patch14_dinov2.lvd142m")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("timm/vit_base_patch14_dinov2.lvd142m", dtype="auto") - Notebooks
- Google Colab
- Kaggle
Class indices dictionary or lookup
Is there a dictionary of class indices to their english name anywhere?
I can see some online for other versions of Imagenet, such as the Imagenet 1,000 dataset, but I think they may have changed - as I've checked predictions from this against those and they're all over the place - the example image is apparently a weasel and cats come out as monkeys etc.
This is what I found, but it's not right: https://deeplearning.cms.waikato.ac.nz/user-guide/class-maps/IMAGENET/
@rwightman No worries, I was just confused because there's classification code on there and had assumed that would classify based on some set of labels https://huggingface.co/timm/vit_base_patch14_dinov2.lvd142m#image-classification
@MartinKS sorry yeah, I have that on the backburner somewhere, there are a number of models in timm without classifiers these days (that are usually amazing for fine-tune because pretrained on large semi/self supervised datasets), but they're tagged as classification right now so they get those default snippets and have the classification widget active, woops! I need to fix that.