yolo_standard_libray/007yolov8验证.py
2025-03-07 11:35:40 +08:00

15 lines
447 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from ultralytics import YOLO
'''
注意修改配置文件中的文件夹路径
'''
# train2yolov8n
model = YOLO('5000_HeadHelmet/train/weights/best.pt')
# Validate the model
metrics = model.val() # no arguments needed, dataset and settings remembered
print(metrics.box.map) # map50-95
print(metrics.box.map50) # map50
print(metrics.box.map75) # map75
print(metrics.box.maps) # a list contains map50-95 of each category