Skriller0208/Crop-Weed-Classifier
Viewer โข Updated โข 804 โข 37
How to use Skriller0208/Crop-Weed-Classifier with ultralytics:
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
# pick the weights file from this repo's "Files and versions" tab
weights = hf_hub_download("Skriller0208/Crop-Weed-Classifier", "<weights>.pt")
model = YOLO(weights)
source = 'http://images.cocodataset.org/val2017/000000039769.jpg'
model.predict(source=source, save=True)A YOLOv8n detector that finds and labels plants in field photos as Crop or Weed.
Fine-tuned from yolov8n.pt with Ultralytics 8.0.196 on the
Crop Weed Classifier dataset
(402 images, 640ร640).
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
model = YOLO(hf_hub_download("Skriller0208/Crop-Weed-Classifier", "best.pt"))
results = model("field.jpg")
results[0].show()
Classes: 0 = Crop, 1 = Weed.
| Path | What it is |
|---|---|
best.pt |
Checkpoint trained 3 March 2024. No metrics were saved for this run. |
runs/detect/train/weights/best.pt, last.pt |
Checkpoints from the 19 May 2024 run, same data and settings. The metrics below are for this run. |
runs/detect/train/ |
args.yaml, results.csv, loss/metric curves, confusion matrices, sample batches |
runs/detect/val/ |
Validation curves and prediction samples |
runs/detect/predict/, predict2/ |
Example predictions |
data.yaml |
Dataset config used for training |
| Setting | Value |
|---|---|
| Base model | yolov8n.pt |
| Epochs | 20 |
| Image size | 640 |
| Batch size | 16 |
| Optimizer | auto (lr0 0.01) |
| Augmentation | Ultralytics defaults (mosaic, horizontal flip, HSV) |
Full arguments are in runs/detect/train/args.yaml.
Trained on about 280 images for 20 epochs, and validated on 81 images from the same source, so the numbers say little about other crops, growth stages, cameras or lighting. Weed boxes outnumber Crop boxes roughly 3 to 1 in the training data.
Weights derive from Ultralytics YOLOv8 and are released under AGPL-3.0. The training data is CC BY 4.0.