🔄Update: [Lab-5] 基于YOLOv8的工业缺陷检测实验

This commit is contained in:
2025-11-07 15:09:34 +08:00
parent 47cfade856
commit 0e04debb7b
7 changed files with 116 additions and 1 deletions
+9
View File
@@ -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}")