当前位置:   article > 正文

yolo7 自定义数据训练

yolo7 自定义数据训练

数据打标labelimg

预定义标签 格式name label 

数据集定义文件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

  1. /home/kean/works/yolov7/dataset/errorimg/0001_20240827161436885_000002_error_dialog_000000_10.jpg
  2. /home/kean/works/yolov7/dataset/errorimg/0001_20240827161535653_000004_error_dialog_000000_11.jpg
  3. /home/kean/works/yolov7/dataset/errorimg/0001_20240827161607499_000000_error_dialog_000000_000000_1.jpg
  4. /home/kean/works/yolov7/dataset/errorimg/0001_20240827161624781_000005_error_dialog_000000_12.jpg
  5. /home/kean/works/yolov7/dataset/errorimg/0001_20240827161653984_000007_error_dialog_000000_2.jpg
  6. /home/kean/works/yolov7/dataset/errorimg/0001_20240827161706026_000008_error_dialog_000000_3.jpg
  7. /home/kean/works/yolov7/dataset/errorimg/0001_20240827161718809_000009_error_dialog_000000_4.jpg
  8. /home/kean/works/yolov7/dataset/errorimg/0001_20240827161730368_000010_error_dialog_000000_5.jpg
  9. /home/kean/works/yolov7/dataset/errorimg/0001_20240827161742384_000011_error_dialog_000000_6.jpg
  10. /home/kean/works/yolov7/dataset/errorimg/0001_20240827161753549_000012_error_dialog_000000_8.jpg
  11. /home/kean/works/yolov7/dataset/errorimg/0001_20240827161804745_000013_error_dialog_000000_9.jpg
  12. /home/kean/works/yolov7/dataset/errorimg/0001_20240827161640191_000006_error_dialog_000000_13.png

图片文件和标签文件放在一起

执行训练:

(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
 

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号