ayoubkirouane
commited on
Commit
•
cc1fad9
1
Parent(s):
3dba043
Update README.md
Browse files
README.md
CHANGED
@@ -58,4 +58,32 @@ The goal of this model is to classify leaf images into three categories:
|
|
58 |
+ Datasets 2.14.5
|
59 |
+ Tokenizers 0.13.3
|
60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
+ Datasets 2.14.5
|
59 |
+ Tokenizers 0.13.3
|
60 |
|
61 |
+
## Get Started With The Model:
|
62 |
+
```
|
63 |
+
! pip -q install datasets transformers[torch]
|
64 |
+
```
|
65 |
+
|
66 |
+
```python
|
67 |
+
|
68 |
+
from transformers import pipeline
|
69 |
+
from PIL import Image
|
70 |
+
|
71 |
+
# Use a pipeline as a high-level helper
|
72 |
+
|
73 |
+
pipe = pipeline("image-classification", model="ayoubkirouane/VIT_Beans_Leaf_Disease_Classifier")
|
74 |
|
75 |
+
# Load the image
|
76 |
+
|
77 |
+
image_path = "Your image_path "
|
78 |
+
image = Image.open(image_path)
|
79 |
+
|
80 |
+
# Run inference using the pipeline
|
81 |
+
result = pipe(image)
|
82 |
+
|
83 |
+
# The result contains the predicted label and the corresponding score
|
84 |
+
predicted_label = result[0]['label']
|
85 |
+
confidence_score = result[0]['score']
|
86 |
+
|
87 |
+
print(f"Predicted Label: {predicted_label}")
|
88 |
+
print(f"Confidence Score: {confidence_score}")
|
89 |
+
```
|