yolov8对比训练

This commit is contained in:
Yunhao Meng 2025-05-05 17:30:12 +08:00
parent c57c8f3552
commit 2a3e5b17e7
2 changed files with 19 additions and 0 deletions

6
yolov8/yolov8.yaml Normal file
View File

@ -0,0 +1,6 @@
train: /mnt/DATA/dataset/uav_dataset/train/images/
val: /mnt/DATA/dataset/uav_dataset/val/images/
test: /mnt/DATA/dataset/test2/images/
# number of classes
nc: 1
names: ['uav']

13
yolov8/yolov8_train.py Normal file
View File

@ -0,0 +1,13 @@
from ultralytics import YOLO
# 加载预训练模型
model = YOLO('../yolov8n.pt')
# 开始训练
model.train(
data='./yolov8.yaml', # 数据配置文件路径
epochs=320, # 训练轮数
batch=-1, # 批量大小
imgsz=640, # 输入图片大小
device=0 # 使用的设备0 表示 GPU'cpu' 表示 CPU
)