Skip to content

Commit 001d34c

Browse files
committed
fix issues: #1 ,yolov6 infer update
1 parent 5516438 commit 001d34c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2986
-447
lines changed

configs/yolov5u/README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# YOLOv5u
2+
3+
## 模型库
4+
5+
### 基础模型
6+
7+
| 网络网络 | 输入尺寸 | 图片数/GPU | 学习率策略 | 模型推理耗时(ms) | mAP<sup>val<br>0.5:0.95 | mAP<sup>val<br>0.5 | Params(M) | FLOPs(G) | 下载链接 | 配置文件 |
8+
| :------------- | :------- | :-------: | :------: | :------------: | :---------------------: | :----------------: |:---------: | :------: |:---------------: |:-----: |
9+
| YOLOv5u-n | 640 | 16 | 300e | 1.61 | 34.5 | 49.7 | 2.65 | 7.79 | [下载链接](https://paddledet.bj.bcebos.com/models/yolov5u_n_300e_coco.pdparams) | [配置文件](./yolov5u_n_300e_coco.yml) |
10+
| YOLOv5u-s | 640 | 16 | 300e | 2.66 | 43.0 | 59.7 | 9.15 | 24.12 | [下载链接](https://paddledet.bj.bcebos.com/models/yolov5u_s_300e_coco.pdparams) | [配置文件](./yolov5u_s_300e_coco.yml) |
11+
| YOLOv5u-m | 640 | 16 | 300e | 5.50 | 49.0 | 65.7 | 25.11 | 64.42 | [下载链接](https://paddledet.bj.bcebos.com/models/yolov5u_m_300e_coco.pdparams) | [配置文件](./yolov5u_m_300e_coco.yml) |
12+
| YOLOv5u-l | 640 | 16 | 300e | 8.73 | 52.2 | 69.0 | 53.23 | 135.34 | [下载链接](https://paddledet.bj.bcebos.com/models/yolov5u_l_300e_coco.pdparams) | [配置文件](./yolov5u_l_300e_coco.yml) |
13+
| YOLOv5u-x | 640 | 16 | 300e | 15.49 | 53.1 | 69.9 | 97.28 | 246.89 | [下载链接](https://paddledet.bj.bcebos.com/models/yolov5u_x_300e_coco.pdparams) | [配置文件](./yolov5u_x_300e_coco.yml) |
14+
15+
### P6大尺度模型
16+
17+
| 网络网络 | 输入尺寸 | 图片数/GPU | 学习率策略 | 模型推理耗时(ms) | mAP<sup>val<br>0.5:0.95 | mAP<sup>val<br>0.5 | Params(M) | FLOPs(G) | 下载链接 | 配置文件 |
18+
| :------------- | :------- | :-------: | :------: | :------------: | :---------------------: | :----------------: |:---------: | :------: |:---------------: |:-----: |
19+
| YOLOv5u_p6-n | 1280 | 16 | 300e | - | 42.2 | 58.6 | 4.33 | 15.79 | [下载链接](https://paddledet.bj.bcebos.com/models/yolov5up6_n_300e_coco.pdparams) | [配置文件](./yolov5up6_n_300e_coco.yml) |
20+
| YOLOv5u_p6-s | 1280 | 16 | 300e | - | 48.6 | 65.8 | 15.31 | 49.02 | [下载链接](https://paddledet.bj.bcebos.com/models/yolov5up6_s_300e_coco.pdparams) | [配置文件](./yolov5up6_s_300e_coco.yml) |
21+
| YOLOv5u_p6-m | 1280 | 16 | 300e | - | 53.3 | 70.3 | 41.22 | 131.06 | [下载链接](https://paddledet.bj.bcebos.com/models/yolov5up6_m_300e_coco.pdparams) | [配置文件](./yolov5up6_m_300e_coco.yml) |
22+
| YOLOv5u_p6-l | 1280 | 8 | 300e | - | 55.4 | 72.2 | 86.10 | 275.38 | [下载链接](https://paddledet.bj.bcebos.com/models/yolov5up6_l_300e_coco.pdparams) | [配置文件](./yolov5up6_l_300e_coco.yml) |
23+
| YOLOv5u_p6-x | 1280 | 8 | 300e | - | 56.4 | 73.1 | 155.54 | 502.38 | [下载链接](https://paddledet.bj.bcebos.com/models/yolov5up6_x_300e_coco.pdparams) | [配置文件](./yolov5p6_x_3yolov5up6_x_300e_coco00e_coco.yml) |
24+
25+
26+
**注意:**
27+
- YOLOv5u 模型表示YOLOv5使用YOLOv8的head和loss,是Anchor Free的检测方案;
28+
- YOLOv5u 模型训练使用COCO train2017作为训练集,Box AP为在COCO val2017上的`mAP(IoU=0.5:0.95)`结果;
29+
- 使用教程可参照[YOLOv5](../yolov5)
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
epoch: 300
2+
3+
LearningRate:
4+
base_lr: 0.01
5+
schedulers:
6+
- !YOLOv5LRDecay
7+
max_epochs: 300
8+
min_lr_ratio: 0.01
9+
- !ExpWarmup
10+
epochs: 3
11+
12+
OptimizerBuilder:
13+
optimizer:
14+
type: Momentum
15+
momentum: 0.937
16+
use_nesterov: True
17+
regularizer:
18+
factor: 0.001
19+
type: L2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
epoch: 300
2+
3+
LearningRate:
4+
base_lr: 0.01
5+
schedulers:
6+
- !YOLOv5LRDecay
7+
max_epochs: 300
8+
min_lr_ratio: 0.1
9+
- !ExpWarmup
10+
epochs: 3
11+
12+
OptimizerBuilder:
13+
optimizer:
14+
type: Momentum
15+
momentum: 0.937
16+
use_nesterov: True
17+
regularizer:
18+
factor: 0.001
19+
type: L2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
architecture: YOLOv5
2+
norm_type: sync_bn
3+
use_ema: True
4+
ema_decay: 0.9999
5+
ema_decay_type: "exponential"
6+
act: silu
7+
find_unused_parameters: True
8+
9+
depth_mult: 1.0
10+
width_mult: 1.0
11+
12+
YOLOv5:
13+
backbone: CSPDarkNet
14+
neck: YOLOCSPPAN
15+
yolo_head: YOLOv8Head
16+
post_process: ~
17+
18+
CSPDarkNet:
19+
arch: "P5"
20+
return_idx: [2, 3, 4]
21+
depthwise: false
22+
23+
YOLOCSPPAN:
24+
depthwise: false
25+
26+
YOLOv8Head:
27+
fpn_strides: [8, 16, 32]
28+
loss_weight: {class: 0.5, iou: 7.5, dfl: 1.5}
29+
assigner:
30+
name: TaskAlignedAssigner
31+
topk: 10
32+
alpha: 0.5
33+
beta: 6.0
34+
nms:
35+
name: MultiClassNMS
36+
nms_top_k: 3000
37+
keep_top_k: 300
38+
score_threshold: 0.001
39+
nms_threshold: 0.7
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
input_height: &input_height 640
2+
input_width: &input_width 640
3+
input_size: &input_size [*input_height, *input_width]
4+
mosaic_epoch: &mosaic_epoch 290 # last 10 epochs close mosaic, totally 300 epochs as default
5+
6+
worker_num: 4
7+
TrainReader:
8+
sample_transforms:
9+
- Decode: {}
10+
- MosaicPerspective: {mosaic_prob: 1.0, target_size: *input_size}
11+
- RandomHSV: {hgain: 0.015, sgain: 0.7, vgain: 0.4}
12+
- RandomFlip: {}
13+
batch_transforms:
14+
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
15+
- Permute: {}
16+
- PadGT: {}
17+
batch_size: 8
18+
shuffle: True
19+
drop_last: False
20+
use_shared_memory: True
21+
collate_batch: True
22+
mosaic_epoch: *mosaic_epoch
23+
24+
25+
EvalReader:
26+
sample_transforms:
27+
- Decode: {}
28+
- Resize: {target_size: *input_size, keep_ratio: True, interp: 1}
29+
- Pad: {size: *input_size, fill_value: [114., 114., 114.]}
30+
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
31+
- Permute: {}
32+
batch_size: 8
33+
34+
35+
TestReader:
36+
inputs_def:
37+
image_shape: [3, 640, 640]
38+
sample_transforms:
39+
- Decode: {}
40+
- Resize: {target_size: *input_size, keep_ratio: True, interp: 1}
41+
- Pad: {size: *input_size, fill_value: [114., 114., 114.]}
42+
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
43+
- Permute: {}
44+
batch_size: 1
45+
fuse_normalize: False
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
input_height: &input_height 640
2+
input_width: &input_width 640
3+
input_size: &input_size [*input_height, *input_width]
4+
mosaic_epoch: &mosaic_epoch 290 # last 10 epochs close mosaic, totally 300 epochs as default
5+
6+
worker_num: 4
7+
TrainReader:
8+
sample_transforms:
9+
- Decode: {}
10+
- MosaicPerspective: {mosaic_prob: 1.0, target_size: *input_size, scale: 0.9, mixup_prob: 0.1, copy_paste_prob: 0.1}
11+
- RandomHSV: {hgain: 0.015, sgain: 0.7, vgain: 0.4}
12+
- RandomFlip: {}
13+
batch_transforms:
14+
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
15+
- Permute: {}
16+
- PadGT: {}
17+
batch_size: 8
18+
shuffle: True
19+
drop_last: False
20+
use_shared_memory: True
21+
collate_batch: True
22+
mosaic_epoch: *mosaic_epoch
23+
24+
25+
EvalReader:
26+
sample_transforms:
27+
- Decode: {}
28+
- Resize: {target_size: *input_size, keep_ratio: True, interp: 1}
29+
- Pad: {size: *input_size, fill_value: [114., 114., 114.]}
30+
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
31+
- Permute: {}
32+
batch_size: 8
33+
34+
35+
TestReader:
36+
inputs_def:
37+
image_shape: [3, 640, 640]
38+
sample_transforms:
39+
- Decode: {}
40+
- Resize: {target_size: *input_size, keep_ratio: True, interp: 1}
41+
- Pad: {size: *input_size, fill_value: [114., 114., 114.]}
42+
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
43+
- Permute: {}
44+
batch_size: 1
45+
fuse_normalize: False
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
_BASE_: [
2+
'yolov5u_cspdarknet.yml',
3+
]
4+
5+
CSPDarkNet:
6+
arch: "P6"
7+
return_idx: [2, 3, 4, 5]
8+
9+
YOLOCSPPAN:
10+
depthwise: false
11+
12+
YOLOv8Head:
13+
fpn_strides: [8, 16, 32, 64]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
input_height: &input_height 1280
2+
input_width: &input_width 1280
3+
input_size: &input_size [*input_height, *input_width]
4+
mosaic_epoch: &mosaic_epoch 290 # last 10 epochs close mosaic, totally 300 epochs as default
5+
6+
worker_num: 4
7+
TrainReader:
8+
sample_transforms:
9+
- Decode: {}
10+
- MosaicPerspective: {mosaic_prob: 1.0, target_size: *input_size}
11+
- RandomHSV: {hgain: 0.015, sgain: 0.7, vgain: 0.4}
12+
- RandomFlip: {}
13+
batch_transforms:
14+
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
15+
- Permute: {}
16+
- PadGT: {}
17+
batch_size: 8
18+
shuffle: True
19+
drop_last: False
20+
use_shared_memory: True
21+
collate_batch: True
22+
mosaic_epoch: *mosaic_epoch
23+
24+
25+
EvalReader:
26+
sample_transforms:
27+
- Decode: {}
28+
- Resize: {target_size: *input_size, keep_ratio: True, interp: 1}
29+
- Pad: {size: *input_size, fill_value: [114., 114., 114.]}
30+
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
31+
- Permute: {}
32+
batch_size: 1
33+
34+
35+
TestReader:
36+
inputs_def:
37+
image_shape: [3, 1280, 1280]
38+
sample_transforms:
39+
- Decode: {}
40+
- Resize: {target_size: *input_size, keep_ratio: True, interp: 1}
41+
- Pad: {size: *input_size, fill_value: [114., 114., 114.]}
42+
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
43+
- Permute: {}
44+
batch_size: 1
45+
fuse_normalize: False
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
_BASE_: [
2+
'../datasets/coco_detection.yml',
3+
'../runtime.yml',
4+
'_base_/optimizer_300e_high.yml',
5+
'_base_/yolov5u_cspdarknet.yml',
6+
'_base_/yolov5u_reader_high_aug.yml',
7+
]
8+
depth_mult: 1.0
9+
width_mult: 1.0
10+
11+
log_iter: 100
12+
snapshot_epoch: 10
13+
weights: output/yolov5u_l_300e_coco/model_final
14+
15+
16+
TrainReader:
17+
batch_size: 16 # default 8 gpus, total bs = 128
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
_BASE_: [
2+
'../datasets/coco_detection.yml',
3+
'../runtime.yml',
4+
'_base_/optimizer_300e_high.yml',
5+
'_base_/yolov5u_cspdarknet.yml',
6+
'_base_/yolov5u_reader_high_aug.yml',
7+
]
8+
depth_mult: 0.67
9+
width_mult: 0.75
10+
11+
log_iter: 100
12+
snapshot_epoch: 10
13+
weights: output/yolov5u_m_300e_coco/model_final
14+
15+
16+
TrainReader:
17+
batch_size: 16 # default 8 gpus, total bs = 128
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
_BASE_: [
2+
'../datasets/coco_detection.yml',
3+
'../runtime.yml',
4+
'_base_/optimizer_300e.yml',
5+
'_base_/yolov5u_cspdarknet.yml',
6+
'_base_/yolov5u_reader.yml',
7+
]
8+
depth_mult: 0.33
9+
width_mult: 0.25
10+
11+
log_iter: 100
12+
snapshot_epoch: 10
13+
weights: output/yolov5u_n_300e_coco/model_final
14+
15+
16+
TrainReader:
17+
batch_size: 16 # default 8 gpus, total bs = 128
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
_BASE_: [
2+
'../datasets/coco_detection.yml',
3+
'../runtime.yml',
4+
'_base_/optimizer_300e.yml',
5+
'_base_/yolov5u_cspdarknet.yml',
6+
'_base_/yolov5u_reader.yml',
7+
]
8+
depth_mult: 0.33
9+
width_mult: 0.50
10+
11+
log_iter: 100
12+
snapshot_epoch: 10
13+
weights: output/yolov5u_s_300e_coco/model_final
14+
15+
16+
TrainReader:
17+
batch_size: 16 # default 8 gpus, total bs = 128
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
_BASE_: [
2+
'../datasets/coco_detection.yml',
3+
'../runtime.yml',
4+
'_base_/optimizer_300e_high.yml',
5+
'_base_/yolov5u_cspdarknet.yml',
6+
'_base_/yolov5u_reader_high_aug.yml',
7+
]
8+
depth_mult: 1.33
9+
width_mult: 1.25
10+
11+
log_iter: 100
12+
snapshot_epoch: 10
13+
weights: output/yolov5u_x_300e_coco/model_final
14+
15+
16+
TrainReader:
17+
batch_size: 16 # default 8 gpus, total bs = 128
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
_BASE_: [
2+
'../datasets/coco_detection.yml',
3+
'../runtime.yml',
4+
'_base_/optimizer_300e_high.yml',
5+
'_base_/yolov5up6_cspdarknet.yml',
6+
'_base_/yolov5up6_reader.yml',
7+
]
8+
depth_mult: 1.0
9+
width_mult: 1.0
10+
11+
log_iter: 100
12+
snapshot_epoch: 10
13+
weights: output/yolov5up6_l_300e_coco/model_final
14+
15+
16+
TrainReader:
17+
batch_size: 8 # default 8 gpus, total bs = 64
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
_BASE_: [
2+
'../datasets/coco_detection.yml',
3+
'../runtime.yml',
4+
'_base_/optimizer_300e_high.yml',
5+
'_base_/yolov5up6_cspdarknet.yml',
6+
'_base_/yolov5up6_reader.yml',
7+
]
8+
depth_mult: 0.67
9+
width_mult: 0.75
10+
11+
log_iter: 100
12+
snapshot_epoch: 10
13+
weights: output/yolov5up6_m_300e_coco/model_final
14+
15+
16+
TrainReader:
17+
batch_size: 16 # default 8 gpus, total bs = 128

0 commit comments

Comments
 (0)