Views
No views yet
facebook/dinov2-large (LoRA + custom classification head) on a
plant-disease dataset of 40 classes.1from PIL import Image
2import torch
3from transformers import AutoImageProcessor, AutoModel
4
5repo = "SevakGrigoryan/dinov2-large-plant-disease"
6processor = AutoImageProcessor.from_pretrained(repo)
7model = AutoModel.from_pretrained(repo, trust_remote_code=True).eval()
8
9img = Image.open("leaf.jpg").convert("RGB")
10inputs = processor(images=img, return_tensors="pt")
11with torch.no_grad():
12 logits = model(**inputs)["logits"]
13print(model.config.id2label[int(logits.argmax(-1))])handler.py, so it is one-click deployable as a paid HF
Inference Endpoint. The free serverless Inference API does not support
custom architectures and will not work for this model.