https://github.com/ultralytics/yolov5
链接:https://pan.baidu.com/s/148B6HG1nhxHDrS-9s-CVgg
提取码:llnz
直接运行此py文件
有预测结果,说明环境配置成功了。
打开根目录下面的train.py,修改为以下的参数
然后运行trian.py,开始训练
训练完毕
链接:https://pan.baidu.com/s/1N1IuBkoX2jd_6x4kscSDKg
提取码:l070
复制VisDrone.yaml到同级文件夹并重命名
然后复制下列代码到新的yaml文件
# YOLOv5 by Ultralytics, AGPL-3.0 license
# VisDrone2019-DET dataset https://github.com/VisDrone/VisDrone-Dataset by Tianjin University
# Example usage: python train.py --data VisDrone.yaml
# parent
# ├── yolov5
# └── datasets
# └── VisDrone ← downloads here (2.3 GB)
# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
path: datasets/VisDrone # dataset root dir
train: VisDrone2019-DET-train/images # train images (relative to 'path') 6471 images
val: VisDrone2019-DET-val/images # val images (relative to 'path') 548 images
test: VisDrone2019-DET-test-dev/images # test images (optional) 1610 images
# Classes
names:
0: pedestrian
1: people
2: bicycle
3: car
4: van
5: truck
6: tricycle
7: awning-tricycle
8: bus
9: motor
修改train.py里面的data
开始训练,时间关系,我这里只设置训练了10个epoch