目录
- [0 相关资料](#0 相关资料)
- [1 SCB-Dataset3-U 数据](#1 SCB-Dataset3-U 数据)
- [2 YOLOv8 训练](#2 YOLOv8 训练)
-
- [2.1 YOLOv8 安装](#2.1 YOLOv8 安装)
- [2.2 训练的yaml文件](#2.2 训练的yaml文件)
- [2.3 YOLOv8 训练](#2.3 YOLOv8 训练)
-
- [2.3.1 yolov8n 训练](#2.3.1 yolov8n 训练)
- [2.3.2 yolov8n 验证](#2.3.2 yolov8n 验证)
0 相关资料
YOLOV8环境安装教程.:https://www.bilibili.com/video/BV1dG4y1c7dH/
YOLOV8保姆级教学视频:https://www.bilibili.com/video/BV1qd4y1L7aX/
1 SCB-Dataset3-U 数据
这里使用YOLOv8 训练自定义数据集(SCB-Dataset3)
备注:关于SCB-Dataset3我会公开在github中:
https://github.com/Whiffe/SCB-dataset
在平台中上传数据,通过阿里云盘的方式上传
unzip 5k_HRW_yolo_Dataset.zip
unzip 0.355k_university_yolo_Dataset.zip
unzip 0.71k_university_yolo_Dataset.zip
2 YOLOv8 训练
2.1 YOLOv8 安装
PyTorch / 2.0.0 / 3.8(ubuntu20.04) / 11.8
git clone https://github.com/ultralytics/ultralytics
推荐
git clone https://gitee.com/YFwinston/ultralytics
cd ultralytics/
pip install ultralytics
2.2 训练的yaml文件
将下面的文件放到:ultralytics/ultralytics/datasets/
0.71k_university_yolo_Dataset.yaml
train: /root/autodl-tmp/0.71k_university_yolo_Dataset/images/train
val: /root/autodl-tmp/0.71k_university_yolo_Dataset/images/val
# number of classes
nc: 6
# class names
names: [ 'hand-raising','reading','writing','using phone','bowing the head','leaning over the table ']
2.3 YOLOv8 训练
下载与上传模型
2.3.1 yolov8n 训练
yolo task=detect mode=train model=yolov8n.pt data="./ultralytics/datasets/0.71k_university_yolo_Dataset.yaml" batch=8 && /usr/bin/shutdown
2.3.2 yolov8n 验证
yolo task=detect mode=val model=runs/detect/train/weights/best.pt data="./ultralytics/datasets/0.71k_university_yolo_Dataset.yaml"