Skip to content

Commit c53486b

Browse files
committed
update
1 parent e8f26a1 commit c53486b

File tree

4 files changed

+27
-11
lines changed

4 files changed

+27
-11
lines changed

configs/_base_/models/retinanet_r50_fpn.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,17 @@
7171
type='DetTTAModel',
7272
tta_cfg=dict(nms=dict(type='nms', iou_threshold=0.5), max_per_img=100))
7373

74+
img_scales = [(1333, 800), (666, 400), (2000, 1200)]
7475
tta_pipeline = [
7576
dict(type='LoadImageFromFile', file_client_args=dict(backend='disk')),
7677
dict(
7778
type='TestTimeAug',
78-
transforms=[[dict(type='Resize', scale=(1333, 800), keep_ratio=True)],
79-
[
80-
dict(type='RandomFlip', prob=1.),
81-
dict(type='RandomFlip', prob=0.)
82-
],
79+
transforms=[[
80+
dict(type='Resize', scale=s, keep_ratio=True) for s in img_scales
81+
], [
82+
dict(type='RandomFlip', prob=1.),
83+
dict(type='RandomFlip', prob=0.)
84+
],
8385
[
8486
dict(
8587
type='PackDetInputs',

configs/centernet/centernet_r18-dcnv2_8xb16-crop512-140e_coco.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@
147147
type='TestTimeAug',
148148
transforms=[
149149
[
150-
# ``RandomFlip`` must be placed before ``RandomCenterCropPad``
150+
# ``RandomFlip`` must be placed before ``RandomCenterCropPad``,
151+
# otherwise bounding box coordinates after flipping cannot be
152+
# recovered correctly.
151153
dict(type='RandomFlip', prob=1.),
152154
dict(type='RandomFlip', prob=0.)
153155
],

configs/rtmdet/rtmdet_l_8xb32-300e_coco.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,21 +187,27 @@
187187
type='DetTTAModel',
188188
tta_cfg=dict(nms=dict(type='nms', iou_threshold=0.6), max_per_img=100))
189189

190+
img_scales = [(640, 640), (320, 320), (960, 960)]
190191
tta_pipeline = [
191192
dict(type='LoadImageFromFile', file_client_args=dict(backend='disk')),
192193
dict(
193194
type='TestTimeAug',
194195
transforms=[
195-
[dict(type='Resize', scale=(640, 640), keep_ratio=True)],
196196
[
197-
# ``RandomFlip`` must be placed before ``Pad``
197+
dict(type='Resize', scale=s, keep_ratio=True)
198+
for s in img_scales
199+
],
200+
[
201+
# ``RandomFlip`` must be placed before ``Pad``, otherwise
202+
# bounding box coordinates after flipping cannot be
203+
# recovered correctly.
198204
dict(type='RandomFlip', prob=1.),
199205
dict(type='RandomFlip', prob=0.)
200206
],
201207
[
202208
dict(
203209
type='Pad',
204-
size=(640, 640),
210+
size=(960, 960),
205211
pad_val=dict(img=(114, 114, 114))),
206212
],
207213
[

configs/yolox/yolox_s_8xb8-300e_coco.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,20 @@
240240
type='DetTTAModel',
241241
tta_cfg=dict(nms=dict(type='nms', iou_threshold=0.65), max_per_img=100))
242242

243+
img_scales = [(640, 640), (320, 320), (960, 960)]
243244
tta_pipeline = [
244245
dict(type='LoadImageFromFile', file_client_args=dict(backend='disk')),
245246
dict(
246247
type='TestTimeAug',
247248
transforms=[
248-
[dict(type='Resize', scale=img_scale, keep_ratio=True)],
249249
[
250-
# ``RandomFlip`` must be placed before ``Pad``
250+
dict(type='Resize', scale=s, keep_ratio=True)
251+
for s in img_scales
252+
],
253+
[
254+
# ``RandomFlip`` must be placed before ``Pad``, otherwise
255+
# bounding box coordinates after flipping cannot be
256+
# recovered correctly.
251257
dict(type='RandomFlip', prob=1.),
252258
dict(type='RandomFlip', prob=0.)
253259
],

0 commit comments

Comments
 (0)