Team members: Tianjie Zhang, Donglei Wang, Yang Lu
Email: [email protected]
How to run:
-
Download this repository and put it in your tutorial file folder.
-
open the terminal and go to your file folder:
cd 'your_path'
- Run the following code to train the mdoel.
python train_dsps.py --data data/dsps.yaml --epochs 400 --weights yolov5s.pt --cfg yolov5s.yaml --batch-size 16 --hyp data/hyps/hyp.scratch-med.yaml
- After training, run the detec.py to test the result.
python detect_dsps.py --weights 'your_trained .pt file path' --source test_data --conf-thres 0.65 --iou-thres 0.999 --augment
Other way: run the DSPS_task1.ipynb directly.
Strategy used:
- Using wGAN to generate real-like images;
- using random crop, flip and contrast adjusting to augment the images;
- A feature-balanced strategy: try to make the amount of different defects equal'
- Fine tune of the hyperparameters: training: epochs = 400, batch_size = 16, hyp = hyp.scatch-med.yaml testing: conf-thres = 0.65, iou-thres = 0.999, augment = true
How to run:
- open the terminal and go to your file folder:
cd 'your_path'
- Run the following code to train the mdoel.
python train_dsps.py --data data/dsps2.yaml --epochs 400 --weights yolov5s.pt --cfg yolov5l_simAM.yaml --batch-size 16 --hyp data/hyps/hyp.scratch-med.yaml
- After training, run the detec.py to test the result.
python detect_dsps2.py --weights runs/train/exp10/weights/best.pt --source images/ --conf-thres 0.65 --iou-thres 0.999 --augment
Other way: run the DSPS_task2.ipynb directly.
Strategy used:
A sinAM Attention module was used to modify the yolov5l model.
Links: