🔄Update: [Lab-5] 基于YOLOv8的工业缺陷检测实验
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
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}")
|
||||
Reference in New Issue
Block a user