10 lines
295 B
Python
10 lines
295 B
Python
from ultralytics import YOLO
|
|
|
|
# 加载最佳模型
|
|
best_model = YOLO('runs/detect/yolov8n_pcb_defect_exp14/weights/best.pt')
|
|
|
|
# 在测试集上评估
|
|
metrics = best_model.val() # 程序会自动计算mAP等指标
|
|
print(f"mAP@0.5: {metrics.box.map50}")
|
|
print(f"mAP@0.5:0.95: {metrics.box.map}")
|