准备 data.yaml 文件
从roboflow 上下载 CS 游戏数据集, 因为只有CPU, 我对数据集做了瘦身, train: 689张, val: 23张, test:40张.
https://universe.roboflow.com/roboflow-100/csgo-videogame/dataset/2
train: ../train/images
val: ../valid/images
test: ../test/images
nc: 2
names: ['CT', 'T']
roboflow:
workspace: roboflow-100
project: csgo-videogame
version: 2
license: CC BY 4.0
url: https://universe.roboflow.com/roboflow-100/csgo-videogame/dataset/2
训练
# 使用 yolov8n.pt 预训练模型进行 train, 不含val
.\yolo task=detect mode=train val=False data=D:\my_workspace\data.yaml model=yolov8n.pt epochs=115 workers=1 imgsz=640
# 或者使用 yolov8n.pt 预训练模型进行 train+val
.\yolo task=detect mode=train val=True data=D:\my_workspace\data.yaml model=yolov8n.pt epochs=115 workers=1 imgsz=640
val
.\yolo task=detect mode=val split=val data=D:\my_workspace\data.yaml model=path\weights\best.pt workers=1 imgsz=640
test
.\yolo task=detect mode=val split=test data=D:\my_workspace\data.yaml model=path\weights\best.pt workers=1 imgsz=640
predict
# predict 单张图片
.\yolo predict model=path\weights\best.pt conf=0.25 source='D:\my_workspace\my.jpg'
# predict 整个目录
.\yolo predict model=path\weights\best.pt conf=0.25 source='D:\my_workspace'
标签:roboflow,val,pt,my,YoloV8,workspace,命令行,视觉,data
From: https://www.cnblogs.com/harrychinese/p/17963898