🔄Update: [Lab-4] yolov8n Val

This commit is contained in:
2025-11-05 19:01:57 +08:00
parent b5a0d5f1f3
commit 0a07cffe2a
+14
View File
@@ -0,0 +1,14 @@
from ultralytics import YOLO
# 加载训练得到的最佳模型
best_model = YOLO('runs/detect/yolov8n_coco128_exp1/weights/best.pt')
# 在验证集上评估模型
metrics = best_model.val()
# 程序会自动打印出mAP、 Precision、 Recall等关键指标
# 加载训练得到的最佳模型
best_model = YOLO('runs/detect/yolov8n_coco128_exp1/weights/best.pt')
# 在验证集上评估模型
metrics = best_model.val()
# 程序会自动打印出mAP、 Precision、 Recall等关键指标。