|
Download README.md from sanjayBalu/leaf-detection: direct link, hf CLI and curl.
- Browser
- Download file 1.56 kB
-
https://huggingface.co/sanjayBalu/leaf-detection/resolve/main/README.md
- Command line
-
hf download hf://sanjayBalu/leaf-detection/README.md
-
curl -L -o README.md https://huggingface.co/sanjayBalu/leaf-detection/resolve/main/README.md
1.56 kB
metadata
license: mit
base_model:
- Ultralytics/YOLO11
pipeline_tag: object-detection
tags:
- plant
- leaf
- leaves
YOLOv11 Model for Plant Leaves Detection
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
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()


