参考: https://github.com/datawhalechina/team-learning-cv/tree/master/DefectDetection
天池地址: https://tianchi.aliyun.com/competition/entrance/531864/information
一、数据处理
首先,从上面GitHub参考下载源代码,从上面天池地址下载数据集并解压至defect_detection下的train_data文件夹。
1.终端运行:python convertTrainLabel.py
2.终端运行:python process_data_yolo.py
3.将process_data_yolo.py内的val改为train,再次运行:python process_data_yolo.py
二、开始训练
终端运行:python train.py --cfg models/yolov5x.yaml --batch-size 1 --epochs 2
方便起见,这里设置了batch-size=1,epochs=2