Views
No views yet
clip-vit-large-patch14-finetuned-disease model has been fine-tuned on a dataset specifically curated to identify various diseases affecting plant leaves. This model uses the CLIP architecture to map images of leaves to descriptive captions, helping in the diagnosis and classification of plant diseases.1{
2 0: "Apple leaf with Apple scab",
3 1: "Apple leaf with Black rot",
4 2: "Apple leaf with Cedar apple rust",
5 3: "Healthy Apple leaf",
6 4: "Corn leaf with Cercospora leaf spot (Gray leaf spot)",
7 5: "Corn leaf with Common rust",
8 6: "Corn leaf with Northern Leaf Blight",
9 7: "Healthy Corn leaf",
10 8: "Durian leaf with Algal Leaf Spot",
11 9: "Durian leaf with Leaf Blight",
12 10: "Durian leaf with Leaf Spot",
13 11: "Healthy Durian leaf",
14 12: "Grape leaf with Black rot",
15 13: "Grape leaf with Esca (Black Measles)",
16 14: "Grape leaf with Leaf blight (Isariopsis Leaf Spot)",
17 15: "Healthy Grape leaf",
18 16: "Oil Palm leaf with brown spots",
19 17: "Healthy Oil Palm leaf",
20 18: "Oil Palm leaf with white scale",
21 19: "Orange leaf with Huanglongbing (Citrus greening)",
22 20: "Pepper bell leaf with Bacterial spot",
23 21: "Healthy Pepper bell leaf",
24 22: "Potato leaf with Early blight",
25 23: "Potato leaf with Late blight",
26 24: "Healthy Potato leaf",
27 25: "Rice leaf with Bacterial blight",
28 26: "Rice leaf with Blast",
29 27: "Rice leaf with Brown spot",
30 28: "Rice leaf with Tungro",
31 29: "Healthy Soybean leaf",
32 30: "Strawberry leaf with Leaf scorch",
33 31: "Healthy Strawberry leaf",
34 32: "Tomato leaf with Bacterial spot",
35 33: "Tomato leaf with Early blight",
36 34: "Tomato leaf with Late blight",
37 35: "Tomato leaf with Leaf Mold",
38 36: "Tomato leaf with Septoria leaf spot",
39 37: "Tomato leaf with Spider mites (Two-spotted spider mite)",
40 38: "Tomato leaf with Target Spot",
41 39: "Tomato leaf with Tomato Yellow Leaf Curl Virus",
42 40: "Tomato leaf with Tomato mosaic virus",
43 41: "Healthy Tomato leaf"
44}clip-vit-large-patch14-finetuned-disease model to classify images of plant leaves and generate captions describing their health condition or any disease present. Below is an example of how you can use this model in Python using the Hugging Face Transformers library:1from transformers import CLIPProcessor, CLIPModel
2from PIL import Image
3import requests
4
5# Load the model and processor
6model = CLIPModel.from_pretrained("Keetawan/clip-vit-large-patch14-plant-disease-finetuned")
7processor = CLIPProcessor.from_pretrained("Keetawan/clip-vit-large-patch14-plant-disease-finetuned")
8
9# Load an image of a plant leaf
10image_url = "https://example.com/path_to_your_image.jpg"
11image = Image.open(requests.get(image_url, stream=True).raw)
12
13# Prepare the image
14inputs = processor(text=["Apple leaf with Apple scab", "Healthy Tomato leaf", ...], images=image, return_tensors="pt", padding=True)
15
16# Get predictions
17outputs = model(**inputs)
18logits_per_image = outputs.logits_per_image # Image-text similarity score
19probs = logits_per_image.softmax(dim=1) # Convert logits to probabilities
20
21# Print the most likely label
22predicted_label = probs.argmax().item()
23labels = [
24 "Apple leaf with Apple scab",
25 "Apple leaf with Black rot",
26 ...
27 "Healthy Tomato leaf"
28]
29print(f"Predicted label: {labels[predicted_label]}")@misc{keetawan2024plantdisease,
author = {Keetawan Limaroon},
title = {clip-vit-large-patch14-finetuned-disease: A fine-tuned model for plant disease classification and captioning},
year = {2024},
publisher = {Hugging Face},
url = {https://huggingface.co/Keetawan/clip-vit-large-patch14-plant-disease-finetuned},
}