VisDrone+yolov7 使用adam
VisDrone+yolov7
训练
- 命令
python -m torch.distributed.launch --nproc_per_node 4 --master_port 9527 train.py --workers 4 --device 0,1,2,3 --sync-bn --batch-size 4 --data data/VisDrone.yaml --img 1536 2016 --cfg cfg/training/yolov7.yaml --name yolov7_split_adam --hyp data/hyp.scratch.p5.yaml --multi-scale --adam
分辨率:1536
结果输出所在文件夹:yolov7_split_adam5
验证集
matlab计算
- 命令:
- 结果
python计算
- 命令:
python test.py --data data/VisDrone.yaml --img 3200 --batch 8 --device 0,1 --weights /disk2/lxs/yolov7/runs/train/yolov7_split_adam9/weights/best.pt --name yolov7_val --task val
- 结果
val: Scanning 'datasets/VisDrone/val_list.cache' images and labels... 548 found, 0 missing, 0 empty, 0 corrupted: 100%|███████████████████████████████████████| 548/548 [00:00<?, ?it/s]
Class Images Labels P R mAP@.5 mAP@.5:.95: 100%|█████████████████████████████████████████████████████| 69/69 [02:16<00:00, 1.97s/it]
all 548 38759 0.677 0.606 0.632 0.395
pedestrian 548 8844 0.729 0.715 0.752 0.398
people 548 5125 0.731 0.567 0.619 0.274
bicycle 548 1287 0.599 0.439 0.477 0.243
car 548 14064 0.844 0.895 0.916 0.675
van 548 1975 0.639 0.621 0.641 0.478
truck 548 750 0.684 0.543 0.578 0.406
tricycle 548 1045 0.596 0.519 0.522 0.319
awning-tricycle 548 532 0.456 0.342 0.301 0.194
bus 548 251 0.793 0.709 0.784 0.579
motor 548 4886 0.698 0.711 0.728 0.379
Speed: 212.8/7.0/219.9 ms inference/NMS/total per 3200x3200 image at batch-size 8
Results saved to runs/test/yolov7_val24
测试集
matlab计算
- 命令:
python detect.py --device 0,1 --weights /disk2/lxs/yolov7/runs/train/yolov7_split_adam9/weights/best.pt --save-conf --save-txt --source /disk2/lxs/yolov5/datasets/VisDrone/VisDrone2019-DET-test-dev/images --img-size 2016 --name yolov7_split_adam9_img_2016
- 结果
Evaluation Completed. The peformance of the detector is presented as follows.
Average Precision (AP) @[ IoU=0.50:0.95 | maxDets=500 ] = 0.33%.
Average Precision (AP) @[ IoU=0.50 | maxDets=500 ] = 0.54%.
Average Precision (AP) @[ IoU=0.75 | maxDets=500 ] = 0.37%.
Average Recall (AR) @[ IoU=0.50:0.95 | maxDets= 1 ] = 0.12%.
Average Recall (AR) @[ IoU=0.50:0.95 | maxDets= 10 ] = 0.73%.
Average Recall (AR) @[ IoU=0.50:0.95 | maxDets=100 ] = 1.69%.
Average Recall (AR) @[ IoU=0.50:0.95 | maxDets=500 ] = 1.76%.
python计算
- 命令:
python test.py --data data/VisDrone.yaml --img 2560 --batch 32 --device 0,1 --weights /home/sedlight/lxs/yolov7/runs/train/yolov7_split_adam9/weights/best.pt --name yolov7_test --task test
- 结果
test: Scanning 'datasets/VisDrone/test_list.cache' images and labels... 1610 found, 0 missing, 0 empty, 0 corrupted: 100%|██████████████████████████████████| 1610/1610 [00:00<?, ?it/s]
Class Images Labels P R mAP@.5 mAP@.5:.95: 100%|███████████████████████████████████████████████████| 202/202 [03:41<00:00, 1.10s/it]
all 1610 75102 0.598 0.54 0.529 0.315
pedestrian 1610 21006 0.644 0.555 0.563 0.242
people 1610 6376 0.632 0.347 0.375 0.138
bicycle 1610 1302 0.493 0.29 0.298 0.142
car 1610 28074 0.786 0.874 0.88 0.58
van 1610 5771 0.59 0.589 0.589 0.418
truck 1610 2659 0.636 0.617 0.62 0.425
tricycle 1610 530 0.377 0.528 0.371 0.223
awning-tricycle 1610 599 0.463 0.322 0.306 0.194
bus 1610 2940 0.774 0.666 0.73 0.535
motor 1610 5845 0.59 0.609 0.559 0.256
Speed: 117.0/3.6/120.6 ms inference/NMS/total per 2560x2560 image at batch-size 8
Results saved to runs/test/yolov7_test9
yolov7加CBAM注意力机制
python -m torch.distributed.launch --nproc_per_node 2 --master_port 9527 train.py --workers 4 --device 0,1 --sync-bn --batch-size 2 --data data/VisDrone.yaml --img 1536 2016 --cfg cfg/training/yolov7_att.yaml --name yolov7_split_adam_att --hyp data/hyp.scratch.p5.yaml --multi-scale --adam
运行了几个epoch 效果并不明显 下次可以继续训练
输出文件:yolov7_split_adam_att6