Views
No views yet
pip install -U ultralytics1from ultralytics import YOLO
2
3# load model
4model = YOLO("CADI-AI/yolov12x.pt")
5
6# set confidence threshold
7model.conf = 0.25
8
9# perform inference
10results = model("/path/to/your/image.jpg", size=640)
11
12# parse results
13for result in results:
14 boxes = result.boxes.xyxy # x1, y1, x2, y2
15 scores = result.boxes.conf # confidence scores
16 categories = result.boxes.cls # class indices
17 print(result.names) # {0: 'abiotic', 1: 'disease', 2: 'insect'}
18
19# save results into "results/" folder
20results[0].save(save_dir="results/")yolo train data=data.yaml imgsz=640 batch=16 model=KaraAgroAI/CADI-AI epochs=10| Class | Precision | Recall | mAP@50 | mAP@50-95 |
|---|---|---|---|---|
| all | 0.663 | 0.632 | 0.648 | 0.291 |
| insect | 0.794 | 0.811 | 0.815 | 0.39 |
| abiotic | 0.682 | 0.514 | 0.542 | 0.237 |
| disease | 0.594 | 0.571 | 0.588 | 0.248 |
