File size: 1,555 Bytes
f07b2a2 ccd390f f07b2a2 21cec94 f07b2a2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
---
license: mit
base_model:
- Ultralytics/YOLO11
pipeline_tag: object-detection
tags:
- plant
- leaf
- leaves
---
# YOLOv11 Model for Plant Leaves Detection
![image/png](https://cdn-uploads.huggingface.co/production/uploads/65f9f9fcca8fdc72b5d3b854/ez9_FEOoq8Zt_VkNmBRhB.png)
This is a YOLOv11 model trained for detecting plant leaves.
## Model Details
- **Framework**: Ultralytics YOLO
- **Classes**: Leaf
- **Usage**: Designed for agriculture applications.
## Dataset
Training dataset from https://www.kaggle.com/datasets/alexo98/leaf-detection
Dataset adaptation to YOLO format from https://www.kaggle.com/code/luisolazo/leaf-detection-w-ultralytics-yolov8-and-tflite
## Usage
```python
from ultralytics import YOLO
import cv2
import matplotlib.pyplot as plt
# Load the YOLO model
model = YOLO('yolo11x_leaf.pt')
# Run inference on an image or directory
result = model.predict('file/directory', task="detect", save=False, conf=0.15)
# Load the original image
image_path = result.path
image = cv2.imread(image_path)
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
# Annotate the image with predictions
annotated_image = result.plot()
# Display the annotated image
plt.figure(figsize=(10, 7))
plt.imshow(annotated_image)
plt.axis("off")
plt.title(f"Predictions for Image")
plt.show()
```
## Examples
![image/png](https://cdn-uploads.huggingface.co/production/uploads/65f9f9fcca8fdc72b5d3b854/8vQB1rwEaMVU9O5u0kUdh.png)
![image/png](https://cdn-uploads.huggingface.co/production/uploads/65f9f9fcca8fdc72b5d3b854/4_NqnutjDxmXu2G0c4bWd.png)
|