Downloads · 30 days
0
dhivyasri-d/vit-plant-classifier
vit-plant-classifier is a image classification model from dhivyasri-d. Use it when you need a label for an image.
This model is a fine-tuned Vision Transformer (ViT) on a dataset of Indian medicinal plant leaves. It predicts the plant species based on leaf images.
Downloads · 30 days
0
Access
Public
Updated Jul 30, 2025
Repo size
343 MB
Likes
0
Public
Click a slice to open those files.
.safetensors343 MB · 100%
From the Hugging Face model README
This model is a fine-tuned Vision Transformer (ViT) on a dataset of Indian medicinal plant leaves.
It predicts the plant species based on leaf images.
google/vit-base-patch16-224-in21kfrom transformers import AutoImageProcessor, AutoModelForImageClassification
from PIL import Image
import torch
image = Image.open("your_plant_leaf.jpg")
processor = AutoImageProcessor.from_pretrained("dhivyasri-d/vit-plant-classifier")
model = AutoModelForImageClassification.from_pretrained("dhivyasri-d/vit-plant-classifier")
inputs = processor(images=image, return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
predicted_class_idx = logits.argmax(-1).item()
print("Predicted label:", model.config.id2label[predicted_class_idx])