yolo7 自定义数据训练

数据打标labelimg

yolo7 自定义数据训练_第1张图片

预定义标签 格式name label 

yolo7 自定义数据训练_第2张图片

数据集定义文件errimg.yaml

train: /home/kean/works/yolov7/dataset/train.txt
val: /home/kean/works/yolov7/dataset/val.txt
# number of classes
nc: 1
# class names
names: ["error_dialog"]

数据定义文件train.txt  val.txt

/home/kean/works/yolov7/dataset/errorimg/0001_20240827161436885_000002_error_dialog_000000_10.jpg
/home/kean/works/yolov7/dataset/errorimg/0001_20240827161535653_000004_error_dialog_000000_11.jpg
/home/kean/works/yolov7/dataset/errorimg/0001_20240827161607499_000000_error_dialog_000000_000000_1.jpg
/home/kean/works/yolov7/dataset/errorimg/0001_20240827161624781_000005_error_dialog_000000_12.jpg
/home/kean/works/yolov7/dataset/errorimg/0001_20240827161653984_000007_error_dialog_000000_2.jpg
/home/kean/works/yolov7/dataset/errorimg/0001_20240827161706026_000008_error_dialog_000000_3.jpg
/home/kean/works/yolov7/dataset/errorimg/0001_20240827161718809_000009_error_dialog_000000_4.jpg
/home/kean/works/yolov7/dataset/errorimg/0001_20240827161730368_000010_error_dialog_000000_5.jpg
/home/kean/works/yolov7/dataset/errorimg/0001_20240827161742384_000011_error_dialog_000000_6.jpg
/home/kean/works/yolov7/dataset/errorimg/0001_20240827161753549_000012_error_dialog_000000_8.jpg
/home/kean/works/yolov7/dataset/errorimg/0001_20240827161804745_000013_error_dialog_000000_9.jpg
/home/kean/works/yolov7/dataset/errorimg/0001_20240827161640191_000006_error_dialog_000000_13.png

图片文件和标签文件放在一起yolo7 自定义数据训练_第3张图片

yolo7 自定义数据训练_第4张图片

执行训练:

(yolov7) kean@kean-MS-7D48:~/works/yolov7$ python train.py --weights yolov7.pt  --cfg cfg/training/yolov7.yaml  --data dataset/errimg.yaml --epoch 200 --batch-size 8 --img 640
 

你可能感兴趣的:(深度学习,人工智能)