Skip to content

Commit d54a2a1

Browse files
committed
yolov5 yolov7 synchronous 2.6
1 parent 6fa88b1 commit d54a2a1

21 files changed

+1583
-469
lines changed

configs/yolov5/_base_/yolov5_reader.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,20 @@ mosaic_epoch: &mosaic_epoch 300
66
worker_num: 4
77
TrainReader:
88
sample_transforms:
9-
- Decode: {}
9+
- DecodeNormResize: {target_size: *input_size, mosaic: True}
1010
- MosaicPerspective: {mosaic_prob: 1.0, target_size: *input_size}
1111
- RandomHSV: {hgain: 0.015, sgain: 0.7, vgain: 0.4}
1212
- RandomFlip: {}
1313
- BboxXYXY2XYWH: {}
1414
- NormalizeBox: {}
15-
batch_transforms:
1615
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
16+
- RGBReverse: {} # bgr->rgb
1717
- Permute: {}
18-
- PadGT: {}
1918
batch_size: 8
2019
shuffle: True
2120
drop_last: False
22-
use_shared_memory: True
23-
collate_batch: True
21+
use_shared_memory: False
22+
collate_batch: False
2423
mosaic_epoch: *mosaic_epoch
2524

2625

@@ -31,7 +30,7 @@ EvalReader:
3130
- Pad: {size: *input_size, fill_value: [114., 114., 114.]}
3231
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
3332
- Permute: {}
34-
batch_size: 8
33+
batch_size: 1
3534

3635

3736
TestReader:

configs/yolov5/_base_/yolov5_reader_high_aug.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,20 @@ mosaic_epoch: &mosaic_epoch 300
66
worker_num: 4
77
TrainReader:
88
sample_transforms:
9-
- Decode: {}
9+
- DecodeNormResize: {target_size: *input_size, mosaic: True}
1010
- MosaicPerspective: {mosaic_prob: 1.0, target_size: *input_size, scale: 0.9, mixup_prob: 0.1, copy_paste_prob: 0.1}
1111
- RandomHSV: {hgain: 0.015, sgain: 0.7, vgain: 0.4}
1212
- RandomFlip: {}
1313
- BboxXYXY2XYWH: {}
1414
- NormalizeBox: {}
15-
batch_transforms:
1615
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
16+
- RGBReverse: {} # bgr->rgb
1717
- Permute: {}
18-
- PadGT: {}
1918
batch_size: 8
2019
shuffle: True
2120
drop_last: False
22-
use_shared_memory: True
23-
collate_batch: True
21+
use_shared_memory: False
22+
collate_batch: False
2423
mosaic_epoch: *mosaic_epoch
2524

2625

@@ -31,7 +30,7 @@ EvalReader:
3130
- Pad: {size: *input_size, fill_value: [114., 114., 114.]}
3231
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
3332
- Permute: {}
34-
batch_size: 8
33+
batch_size: 1
3534

3635

3736
TestReader:

configs/yolov7/_base_/yolov7_elannet.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
architecture: YOLOv7
2-
# norm_type: sync_bn
2+
norm_type: sync_bn
33
use_ema: True
44
ema_decay: 0.9999
55
ema_decay_type: "exponential"
@@ -35,7 +35,7 @@ YOLOv7Head:
3535
loss: YOLOv7Loss
3636
nms:
3737
name: MultiClassNMS
38-
nms_top_k: 10000
38+
nms_top_k: 3000
3939
keep_top_k: 300
4040
score_threshold: 0.001
4141
nms_threshold: 0.7

configs/yolov7/_base_/yolov7_reader.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,20 @@ mosaic_epoch: &mosaic_epoch 300
66
worker_num: 4
77
TrainReader:
88
sample_transforms:
9-
- Decode: {}
10-
- MosaicPerspective: {mosaic_prob: 1.0, target_size: *input_size, mixup_prob: 0.15, paste_in_prob: 0.15, translate: 0.2, scale: 0.9}
9+
- DecodeNormResize: {target_size: *input_size, mosaic: True}
10+
- MosaicPerspective: {mosaic_prob: 1.0, target_size: *input_size, scale: 0.9, mixup_prob: 0.1, copy_paste_prob: 0.1}
1111
- RandomHSV: {hgain: 0.015, sgain: 0.7, vgain: 0.4}
1212
- RandomFlip: {}
1313
- BboxXYXY2XYWH: {}
1414
- NormalizeBox: {}
15-
batch_transforms:
1615
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
16+
- RGBReverse: {} # bgr->rgb
1717
- Permute: {}
18-
- PadGT: {}
1918
batch_size: 32
2019
shuffle: True
2120
drop_last: False
22-
use_shared_memory: True
23-
collate_batch: True
21+
use_shared_memory: False
22+
collate_batch: False
2423
mosaic_epoch: *mosaic_epoch
2524

2625

@@ -31,7 +30,7 @@ EvalReader:
3130
- Pad: {size: *input_size, fill_value: [114., 114., 114.]}
3231
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
3332
- Permute: {}
34-
batch_size: 8
33+
batch_size: 1
3534

3635

3736
TestReader:

configs/yolov7/_base_/yolov7_tiny_reader.yml

+9-10
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,40 @@ mosaic_epoch: &mosaic_epoch 300
66
worker_num: 4
77
TrainReader:
88
sample_transforms:
9-
- Decode: {}
9+
- DecodeNormResize: {target_size: *input_size, mosaic: True}
1010
- MosaicPerspective: {mosaic_prob: 1.0, target_size: *input_size, mixup_prob: 0.05, paste_in_prob: 0.05, translate: 0.1, scale: 0.5}
1111
- RandomHSV: {hgain: 0.015, sgain: 0.7, vgain: 0.4}
1212
- RandomFlip: {}
1313
- BboxXYXY2XYWH: {}
1414
- NormalizeBox: {}
15-
batch_transforms:
1615
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
16+
- RGBReverse: {} # bgr->rgb
1717
- Permute: {}
18-
- PadGT: {}
1918
batch_size: 32
2019
shuffle: True
2120
drop_last: False
22-
use_shared_memory: True
23-
collate_batch: True
21+
use_shared_memory: False
22+
collate_batch: False
2423
mosaic_epoch: *mosaic_epoch
2524

2625

2726
EvalReader:
2827
sample_transforms:
2928
- Decode: {}
30-
- Resize: {target_size: [640, 640], keep_ratio: True, interp: 1}
31-
- Pad: {size: [640, 640], fill_value: [114., 114., 114.]}
29+
- Resize: {target_size: *input_size, keep_ratio: True, interp: 1}
30+
- Pad: {size: *input_size, fill_value: [114., 114., 114.]}
3231
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
3332
- Permute: {}
34-
batch_size: 8
33+
batch_size: 1
3534

3635

3736
TestReader:
3837
inputs_def:
3938
image_shape: [3, 640, 640]
4039
sample_transforms:
4140
- Decode: {}
42-
- Resize: {target_size: [640, 640], keep_ratio: True, interp: 1}
43-
- Pad: {size: [640, 640], fill_value: [114., 114., 114.]}
41+
- Resize: {target_size: *input_size, keep_ratio: True, interp: 1}
42+
- Pad: {size: *input_size, fill_value: [114., 114., 114.]}
4443
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
4544
- Permute: {}
4645
batch_size: 1

configs/yolov7/yolov7_l_300e_coco.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ arch: L
1313

1414

1515
TrainReader:
16-
batch_size: 32
16+
batch_size: 16

configs/yolov7/yolov7_tiny_300e_coco.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ act: LeakyReLU
1414

1515

1616
TrainReader:
17-
batch_size: 32
17+
batch_size: 16
1818

1919

2020
YOLOv7Loss:

configs/yolov7/yolov7_tiny_320_300e_coco.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ EvalReader:
1313
- Pad: {size: [320, 320], fill_value: [114., 114., 114.]}
1414
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
1515
- Permute: {}
16-
batch_size: 8
16+
batch_size: 1
1717

1818

1919
TestReader:

configs/yolov7/yolov7_tiny_416_300e_coco.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ EvalReader:
1313
- Pad: {size: [416, 416], fill_value: [114., 114., 114.]}
1414
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
1515
- Permute: {}
16-
batch_size: 8
16+
batch_size: 1
1717

1818

1919
TestReader:

configs/yolov7/yolov7_x_300e_coco.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ arch: X
1313

1414

1515
TrainReader:
16-
batch_size: 32
16+
batch_size: 16

ppdet/core/workspace.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ def __getattr__(self, key):
6767
return self[key]
6868
raise AttributeError("object has no attribute '{}'".format(key))
6969

70+
def __setattr__(self, key, value):
71+
self[key] = value
72+
73+
def copy(self):
74+
new_dict = AttrDict()
75+
for k, v in self.items():
76+
new_dict.update({k: v})
77+
return new_dict
78+
7079

7180
global_config = AttrDict()
7281

@@ -280,4 +289,4 @@ def create(cls_or_name, **kwargs):
280289
# prevent modification of global config values of reference types
281290
# (e.g., list, dict) from within the created module instances
282291
#kwargs = copy.deepcopy(kwargs)
283-
return cls(**cls_kwargs)
292+
return cls(**cls_kwargs)

0 commit comments

Comments
 (0)