diff --git a/configs/_base_/models/ann_r50-d8.py b/configs/_base_/models/ann_r50-d8.py index 07ed0f3c6f..a2cb653827 100644 --- a/configs/_base_/models/ann_r50-d8.py +++ b/configs/_base_/models/ann_r50-d8.py @@ -40,7 +40,7 @@ norm_cfg=norm_cfg, align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/apcnet_r50-d8.py b/configs/_base_/models/apcnet_r50-d8.py index 451cbc4190..c8f5316cbc 100644 --- a/configs/_base_/models/apcnet_r50-d8.py +++ b/configs/_base_/models/apcnet_r50-d8.py @@ -38,7 +38,7 @@ norm_cfg=norm_cfg, align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/ccnet_r50-d8.py b/configs/_base_/models/ccnet_r50-d8.py index 28f7360a21..794148f576 100644 --- a/configs/_base_/models/ccnet_r50-d8.py +++ b/configs/_base_/models/ccnet_r50-d8.py @@ -38,7 +38,7 @@ norm_cfg=norm_cfg, align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/cgnet.py b/configs/_base_/models/cgnet.py index e598abca2e..eff8d9458c 100644 --- a/configs/_base_/models/cgnet.py +++ b/configs/_base_/models/cgnet.py @@ -29,7 +29,7 @@ 10.289121, 9.953208, 4.3097677, 9.490387, 7.674431, 9.396905, 10.347791, 6.3927646, 10.226669, 10.241062, 10.280587, 10.396974, 10.055647 - ]))) -# model training and testing settings -train_cfg = dict(sampler=None) -test_cfg = dict(mode='whole') + ])), + # model training and testing settings + train_cfg=dict(sampler=None), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/danet_r50-d8.py b/configs/_base_/models/danet_r50-d8.py index 65eb170860..2c934939fa 100644 --- a/configs/_base_/models/danet_r50-d8.py +++ b/configs/_base_/models/danet_r50-d8.py @@ -38,7 +38,7 @@ norm_cfg=norm_cfg, align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/deeplabv3_r50-d8.py b/configs/_base_/models/deeplabv3_r50-d8.py index a9f319c2b5..d7a43bee01 100644 --- a/configs/_base_/models/deeplabv3_r50-d8.py +++ b/configs/_base_/models/deeplabv3_r50-d8.py @@ -38,7 +38,7 @@ norm_cfg=norm_cfg, align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/deeplabv3_unet_s5-d16.py b/configs/_base_/models/deeplabv3_unet_s5-d16.py index 9fce47510d..0cd262999d 100644 --- a/configs/_base_/models/deeplabv3_unet_s5-d16.py +++ b/configs/_base_/models/deeplabv3_unet_s5-d16.py @@ -44,7 +44,7 @@ norm_cfg=norm_cfg, align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='slide', crop_size=256, stride=170) + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='slide', crop_size=256, stride=170)) diff --git a/configs/_base_/models/deeplabv3plus_r50-d8.py b/configs/_base_/models/deeplabv3plus_r50-d8.py index f74a1534fb..050e39e091 100644 --- a/configs/_base_/models/deeplabv3plus_r50-d8.py +++ b/configs/_base_/models/deeplabv3plus_r50-d8.py @@ -40,7 +40,7 @@ norm_cfg=norm_cfg, align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/dmnet_r50-d8.py b/configs/_base_/models/dmnet_r50-d8.py index 329c4fe8c2..d22ba52640 100644 --- a/configs/_base_/models/dmnet_r50-d8.py +++ b/configs/_base_/models/dmnet_r50-d8.py @@ -38,7 +38,7 @@ norm_cfg=norm_cfg, align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/dnl_r50-d8.py b/configs/_base_/models/dnl_r50-d8.py index 423dc3b065..edb4c174c5 100644 --- a/configs/_base_/models/dnl_r50-d8.py +++ b/configs/_base_/models/dnl_r50-d8.py @@ -40,7 +40,7 @@ norm_cfg=norm_cfg, align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/emanet_r50-d8.py b/configs/_base_/models/emanet_r50-d8.py index 326a25137a..26adcd4309 100644 --- a/configs/_base_/models/emanet_r50-d8.py +++ b/configs/_base_/models/emanet_r50-d8.py @@ -41,7 +41,7 @@ norm_cfg=norm_cfg, align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/encnet_r50-d8.py b/configs/_base_/models/encnet_r50-d8.py index c643cea62a..be777123a8 100644 --- a/configs/_base_/models/encnet_r50-d8.py +++ b/configs/_base_/models/encnet_r50-d8.py @@ -42,7 +42,7 @@ norm_cfg=norm_cfg, align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/fast_scnn.py b/configs/_base_/models/fast_scnn.py index 06cd83979d..32fdeb6593 100644 --- a/configs/_base_/models/fast_scnn.py +++ b/configs/_base_/models/fast_scnn.py @@ -51,8 +51,7 @@ align_corners=False, loss_decode=dict( type='CrossEntropyLoss', use_sigmoid=True, loss_weight=0.4)), - ]) - -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + ], + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/fcn_hr18.py b/configs/_base_/models/fcn_hr18.py index 8293e06536..c3e299bc89 100644 --- a/configs/_base_/models/fcn_hr18.py +++ b/configs/_base_/models/fcn_hr18.py @@ -46,7 +46,7 @@ norm_cfg=norm_cfg, align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/fcn_r50-d8.py b/configs/_base_/models/fcn_r50-d8.py index 97a11ec961..5e98f6cc91 100644 --- a/configs/_base_/models/fcn_r50-d8.py +++ b/configs/_base_/models/fcn_r50-d8.py @@ -39,7 +39,7 @@ norm_cfg=norm_cfg, align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/fcn_unet_s5-d16.py b/configs/_base_/models/fcn_unet_s5-d16.py index 27b5b60834..a33e797287 100644 --- a/configs/_base_/models/fcn_unet_s5-d16.py +++ b/configs/_base_/models/fcn_unet_s5-d16.py @@ -45,7 +45,7 @@ norm_cfg=norm_cfg, align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='slide', crop_size=256, stride=170) + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='slide', crop_size=256, stride=170)) diff --git a/configs/_base_/models/fpn_r50.py b/configs/_base_/models/fpn_r50.py index ec11717201..86ab327db9 100644 --- a/configs/_base_/models/fpn_r50.py +++ b/configs/_base_/models/fpn_r50.py @@ -30,7 +30,7 @@ norm_cfg=norm_cfg, align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/gcnet_r50-d8.py b/configs/_base_/models/gcnet_r50-d8.py index b679be1254..3d2ad69f5c 100644 --- a/configs/_base_/models/gcnet_r50-d8.py +++ b/configs/_base_/models/gcnet_r50-d8.py @@ -40,7 +40,7 @@ norm_cfg=norm_cfg, align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/lraspp_m-v3-d8.py b/configs/_base_/models/lraspp_m-v3-d8.py index 36e45090c9..93258242a9 100644 --- a/configs/_base_/models/lraspp_m-v3-d8.py +++ b/configs/_base_/models/lraspp_m-v3-d8.py @@ -19,7 +19,7 @@ act_cfg=dict(type='ReLU'), align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/nonlocal_r50-d8.py b/configs/_base_/models/nonlocal_r50-d8.py index 64dbeb080d..5674a39854 100644 --- a/configs/_base_/models/nonlocal_r50-d8.py +++ b/configs/_base_/models/nonlocal_r50-d8.py @@ -40,7 +40,7 @@ norm_cfg=norm_cfg, align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/ocrnet_hr18.py b/configs/_base_/models/ocrnet_hr18.py index fd88780b60..c60f62a7cd 100644 --- a/configs/_base_/models/ocrnet_hr18.py +++ b/configs/_base_/models/ocrnet_hr18.py @@ -62,7 +62,7 @@ align_corners=False, loss_decode=dict( type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), - ]) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + ], + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/ocrnet_r50-d8.py b/configs/_base_/models/ocrnet_r50-d8.py index 0f5ff956c0..615aa3ff70 100644 --- a/configs/_base_/models/ocrnet_r50-d8.py +++ b/configs/_base_/models/ocrnet_r50-d8.py @@ -41,7 +41,7 @@ align_corners=False, loss_decode=dict( type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)) - ]) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + ], + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/pointrend_r50.py b/configs/_base_/models/pointrend_r50.py index 1a56af3a87..9d323dbf94 100644 --- a/configs/_base_/models/pointrend_r50.py +++ b/configs/_base_/models/pointrend_r50.py @@ -45,12 +45,12 @@ align_corners=False, loss_decode=dict( type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)) - ]) -# model training and testing settings -train_cfg = dict( - num_points=2048, oversample_ratio=3, importance_sample_ratio=0.75) -test_cfg = dict( - mode='whole', - subdivision_steps=2, - subdivision_num_points=8196, - scale_factor=2) + ], + # model training and testing settings + train_cfg=dict( + num_points=2048, oversample_ratio=3, importance_sample_ratio=0.75), + test_cfg=dict( + mode='whole', + subdivision_steps=2, + subdivision_num_points=8196, + scale_factor=2)) diff --git a/configs/_base_/models/psanet_r50-d8.py b/configs/_base_/models/psanet_r50-d8.py index 1b45588268..689513fa9d 100644 --- a/configs/_base_/models/psanet_r50-d8.py +++ b/configs/_base_/models/psanet_r50-d8.py @@ -43,7 +43,7 @@ norm_cfg=norm_cfg, align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/pspnet_r50-d8.py b/configs/_base_/models/pspnet_r50-d8.py index cf9d8ce0a8..f451e08ad2 100644 --- a/configs/_base_/models/pspnet_r50-d8.py +++ b/configs/_base_/models/pspnet_r50-d8.py @@ -38,7 +38,7 @@ norm_cfg=norm_cfg, align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/_base_/models/pspnet_unet_s5-d16.py b/configs/_base_/models/pspnet_unet_s5-d16.py index 3be98685c4..fcff9ec4f4 100644 --- a/configs/_base_/models/pspnet_unet_s5-d16.py +++ b/configs/_base_/models/pspnet_unet_s5-d16.py @@ -44,7 +44,7 @@ norm_cfg=norm_cfg, align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='slide', crop_size=256, stride=170) + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='slide', crop_size=256, stride=170)) diff --git a/configs/_base_/models/upernet_r50.py b/configs/_base_/models/upernet_r50.py index 19cf451359..10974962fd 100644 --- a/configs/_base_/models/upernet_r50.py +++ b/configs/_base_/models/upernet_r50.py @@ -38,7 +38,7 @@ norm_cfg=norm_cfg, align_corners=False, loss_decode=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4))) -# model training and testing settings -train_cfg = dict() -test_cfg = dict(mode='whole') + type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), + # model training and testing settings + train_cfg=dict(), + test_cfg=dict(mode='whole')) diff --git a/configs/ann/ann_r50-d8_769x769_40k_cityscapes.py b/configs/ann/ann_r50-d8_769x769_40k_cityscapes.py index 393a400beb..4912bdb9fb 100644 --- a/configs/ann/ann_r50-d8_769x769_40k_cityscapes.py +++ b/configs/ann/ann_r50-d8_769x769_40k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/ann/ann_r50-d8_769x769_80k_cityscapes.py b/configs/ann/ann_r50-d8_769x769_80k_cityscapes.py index 7861a372e9..d1cc072b15 100644 --- a/configs/ann/ann_r50-d8_769x769_80k_cityscapes.py +++ b/configs/ann/ann_r50-d8_769x769_80k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/apcnet/apcnet_r50-d8_769x769_40k_cityscapes.py b/configs/apcnet/apcnet_r50-d8_769x769_40k_cityscapes.py index d0134e31e8..3db6140cb9 100644 --- a/configs/apcnet/apcnet_r50-d8_769x769_40k_cityscapes.py +++ b/configs/apcnet/apcnet_r50-d8_769x769_40k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/apcnet/apcnet_r50-d8_769x769_80k_cityscapes.py b/configs/apcnet/apcnet_r50-d8_769x769_80k_cityscapes.py index 1d863c4f1b..9cac4254f3 100644 --- a/configs/apcnet/apcnet_r50-d8_769x769_80k_cityscapes.py +++ b/configs/apcnet/apcnet_r50-d8_769x769_80k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/ccnet/ccnet_r50-d8_769x769_40k_cityscapes.py b/configs/ccnet/ccnet_r50-d8_769x769_40k_cityscapes.py index d7fd8ccc59..580d59ca69 100644 --- a/configs/ccnet/ccnet_r50-d8_769x769_40k_cityscapes.py +++ b/configs/ccnet/ccnet_r50-d8_769x769_40k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/ccnet/ccnet_r50-d8_769x769_80k_cityscapes.py b/configs/ccnet/ccnet_r50-d8_769x769_80k_cityscapes.py index 6d3b3498bf..c6dac64377 100644 --- a/configs/ccnet/ccnet_r50-d8_769x769_80k_cityscapes.py +++ b/configs/ccnet/ccnet_r50-d8_769x769_80k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/danet/danet_r50-d8_769x769_40k_cityscapes.py b/configs/danet/danet_r50-d8_769x769_40k_cityscapes.py index b8fba930a8..5c5b94e5a2 100644 --- a/configs/danet/danet_r50-d8_769x769_40k_cityscapes.py +++ b/configs/danet/danet_r50-d8_769x769_40k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/danet/danet_r50-d8_769x769_80k_cityscapes.py b/configs/danet/danet_r50-d8_769x769_80k_cityscapes.py index 8b8915d856..c7237ae03c 100644 --- a/configs/danet/danet_r50-d8_769x769_80k_cityscapes.py +++ b/configs/danet/danet_r50-d8_769x769_80k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/deeplabv3/deeplabv3_r50-d8_480x480_40k_pascal_context.py b/configs/deeplabv3/deeplabv3_r50-d8_480x480_40k_pascal_context.py index 0cdb262833..9d493ef527 100644 --- a/configs/deeplabv3/deeplabv3_r50-d8_480x480_40k_pascal_context.py +++ b/configs/deeplabv3/deeplabv3_r50-d8_480x480_40k_pascal_context.py @@ -4,6 +4,7 @@ '../_base_/schedules/schedule_40k.py' ] model = dict( - decode_head=dict(num_classes=60), auxiliary_head=dict(num_classes=60)) -test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) + decode_head=dict(num_classes=60), + auxiliary_head=dict(num_classes=60), + test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320))) optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) diff --git a/configs/deeplabv3/deeplabv3_r50-d8_480x480_80k_pascal_context.py b/configs/deeplabv3/deeplabv3_r50-d8_480x480_80k_pascal_context.py index 84e831a7be..71a0fda48a 100644 --- a/configs/deeplabv3/deeplabv3_r50-d8_480x480_80k_pascal_context.py +++ b/configs/deeplabv3/deeplabv3_r50-d8_480x480_80k_pascal_context.py @@ -4,6 +4,7 @@ '../_base_/schedules/schedule_80k.py' ] model = dict( - decode_head=dict(num_classes=60), auxiliary_head=dict(num_classes=60)) -test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) + decode_head=dict(num_classes=60), + auxiliary_head=dict(num_classes=60), + test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320))) optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) diff --git a/configs/deeplabv3/deeplabv3_r50-d8_769x769_40k_cityscapes.py b/configs/deeplabv3/deeplabv3_r50-d8_769x769_40k_cityscapes.py index fb067d2117..e35d1988f0 100644 --- a/configs/deeplabv3/deeplabv3_r50-d8_769x769_40k_cityscapes.py +++ b/configs/deeplabv3/deeplabv3_r50-d8_769x769_40k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/deeplabv3/deeplabv3_r50-d8_769x769_80k_cityscapes.py b/configs/deeplabv3/deeplabv3_r50-d8_769x769_80k_cityscapes.py index 8b8692140b..dd7c16580d 100644 --- a/configs/deeplabv3/deeplabv3_r50-d8_769x769_80k_cityscapes.py +++ b/configs/deeplabv3/deeplabv3_r50-d8_769x769_80k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/deeplabv3plus/deeplabv3plus_r50-d8_480x480_40k_pascal_context.py b/configs/deeplabv3plus/deeplabv3plus_r50-d8_480x480_40k_pascal_context.py index ee548fb014..318845de1e 100644 --- a/configs/deeplabv3plus/deeplabv3plus_r50-d8_480x480_40k_pascal_context.py +++ b/configs/deeplabv3plus/deeplabv3plus_r50-d8_480x480_40k_pascal_context.py @@ -4,6 +4,7 @@ '../_base_/schedules/schedule_40k.py' ] model = dict( - decode_head=dict(num_classes=60), auxiliary_head=dict(num_classes=60)) -test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) + decode_head=dict(num_classes=60), + auxiliary_head=dict(num_classes=60), + test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320))) optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) diff --git a/configs/deeplabv3plus/deeplabv3plus_r50-d8_480x480_80k_pascal_context.py b/configs/deeplabv3plus/deeplabv3plus_r50-d8_480x480_80k_pascal_context.py index 604cf2bf5e..1736c2397a 100644 --- a/configs/deeplabv3plus/deeplabv3plus_r50-d8_480x480_80k_pascal_context.py +++ b/configs/deeplabv3plus/deeplabv3plus_r50-d8_480x480_80k_pascal_context.py @@ -4,6 +4,7 @@ '../_base_/schedules/schedule_80k.py' ] model = dict( - decode_head=dict(num_classes=60), auxiliary_head=dict(num_classes=60)) -test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) + decode_head=dict(num_classes=60), + auxiliary_head=dict(num_classes=60), + test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320))) optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) diff --git a/configs/deeplabv3plus/deeplabv3plus_r50-d8_769x769_40k_cityscapes.py b/configs/deeplabv3plus/deeplabv3plus_r50-d8_769x769_40k_cityscapes.py index 4fcc062ca8..e4bda3eded 100644 --- a/configs/deeplabv3plus/deeplabv3plus_r50-d8_769x769_40k_cityscapes.py +++ b/configs/deeplabv3plus/deeplabv3plus_r50-d8_769x769_40k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/deeplabv3plus/deeplabv3plus_r50-d8_769x769_80k_cityscapes.py b/configs/deeplabv3plus/deeplabv3plus_r50-d8_769x769_80k_cityscapes.py index e0bfa94576..1420b97a4b 100644 --- a/configs/deeplabv3plus/deeplabv3plus_r50-d8_769x769_80k_cityscapes.py +++ b/configs/deeplabv3plus/deeplabv3plus_r50-d8_769x769_80k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/dmnet/dmnet_r50-d8_769x769_40k_cityscapes.py b/configs/dmnet/dmnet_r50-d8_769x769_40k_cityscapes.py index 49db4da110..19841547a4 100644 --- a/configs/dmnet/dmnet_r50-d8_769x769_40k_cityscapes.py +++ b/configs/dmnet/dmnet_r50-d8_769x769_40k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/dmnet/dmnet_r50-d8_769x769_80k_cityscapes.py b/configs/dmnet/dmnet_r50-d8_769x769_80k_cityscapes.py index 1cf136e110..31d95f96eb 100644 --- a/configs/dmnet/dmnet_r50-d8_769x769_80k_cityscapes.py +++ b/configs/dmnet/dmnet_r50-d8_769x769_80k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/dnlnet/dnl_r50-d8_769x769_40k_cityscapes.py b/configs/dnlnet/dnl_r50-d8_769x769_40k_cityscapes.py index a39ef22988..0666199b63 100644 --- a/configs/dnlnet/dnl_r50-d8_769x769_40k_cityscapes.py +++ b/configs/dnlnet/dnl_r50-d8_769x769_40k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/dnlnet/dnl_r50-d8_769x769_80k_cityscapes.py b/configs/dnlnet/dnl_r50-d8_769x769_80k_cityscapes.py index aba808073d..f7b07c4f47 100644 --- a/configs/dnlnet/dnl_r50-d8_769x769_80k_cityscapes.py +++ b/configs/dnlnet/dnl_r50-d8_769x769_80k_cityscapes.py @@ -5,8 +5,8 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) optimizer = dict( paramwise_cfg=dict( custom_keys=dict(theta=dict(wd_mult=0.), phi=dict(wd_mult=0.)))) diff --git a/configs/emanet/emanet_r50-d8_769x769_80k_cityscapes.py b/configs/emanet/emanet_r50-d8_769x769_80k_cityscapes.py index 0fd9beea03..699aa212c3 100644 --- a/configs/emanet/emanet_r50-d8_769x769_80k_cityscapes.py +++ b/configs/emanet/emanet_r50-d8_769x769_80k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/encnet/encnet_r50-d8_769x769_40k_cityscapes.py b/configs/encnet/encnet_r50-d8_769x769_40k_cityscapes.py index 9f44b425d4..d311e33f56 100644 --- a/configs/encnet/encnet_r50-d8_769x769_40k_cityscapes.py +++ b/configs/encnet/encnet_r50-d8_769x769_40k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/encnet/encnet_r50-d8_769x769_80k_cityscapes.py b/configs/encnet/encnet_r50-d8_769x769_80k_cityscapes.py index aac7f2d443..7b535f3c80 100644 --- a/configs/encnet/encnet_r50-d8_769x769_80k_cityscapes.py +++ b/configs/encnet/encnet_r50-d8_769x769_80k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/fcn/fcn_r50-d8_480x480_40k_pascal_context.py b/configs/fcn/fcn_r50-d8_480x480_40k_pascal_context.py index d124fbf00d..fdc6314f70 100644 --- a/configs/fcn/fcn_r50-d8_480x480_40k_pascal_context.py +++ b/configs/fcn/fcn_r50-d8_480x480_40k_pascal_context.py @@ -2,6 +2,7 @@ '../_base_/models/fcn_r50-d8.py', '../_base_/datasets/pascal_context.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py' ] -model = dict(decode_head=dict(num_classes=60)) -test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) +model = dict( + decode_head=dict(num_classes=60), + test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320))) optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) diff --git a/configs/fcn/fcn_r50-d8_480x480_80k_pascal_context.py b/configs/fcn/fcn_r50-d8_480x480_80k_pascal_context.py index d84f1c8aaf..0870f928b8 100644 --- a/configs/fcn/fcn_r50-d8_480x480_80k_pascal_context.py +++ b/configs/fcn/fcn_r50-d8_480x480_80k_pascal_context.py @@ -2,6 +2,7 @@ '../_base_/models/fcn_r50-d8.py', '../_base_/datasets/pascal_context.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py' ] -model = dict(decode_head=dict(num_classes=60)) -test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) +model = dict( + decode_head=dict(num_classes=60), + test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320))) optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) diff --git a/configs/fcn/fcn_r50-d8_769x769_40k_cityscapes.py b/configs/fcn/fcn_r50-d8_769x769_40k_cityscapes.py index 9a91f9cc96..fca98c1d9a 100644 --- a/configs/fcn/fcn_r50-d8_769x769_40k_cityscapes.py +++ b/configs/fcn/fcn_r50-d8_769x769_40k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/fcn/fcn_r50-d8_769x769_80k_cityscapes.py b/configs/fcn/fcn_r50-d8_769x769_80k_cityscapes.py index bbde29e8e9..7d75cd9f49 100644 --- a/configs/fcn/fcn_r50-d8_769x769_80k_cityscapes.py +++ b/configs/fcn/fcn_r50-d8_769x769_80k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/gcnet/gcnet_r50-d8_769x769_40k_cityscapes.py b/configs/gcnet/gcnet_r50-d8_769x769_40k_cityscapes.py index ac9826ad92..332495d3d7 100644 --- a/configs/gcnet/gcnet_r50-d8_769x769_40k_cityscapes.py +++ b/configs/gcnet/gcnet_r50-d8_769x769_40k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/gcnet/gcnet_r50-d8_769x769_80k_cityscapes.py b/configs/gcnet/gcnet_r50-d8_769x769_80k_cityscapes.py index cacf24e4f3..d6d9cb1c64 100644 --- a/configs/gcnet/gcnet_r50-d8_769x769_80k_cityscapes.py +++ b/configs/gcnet/gcnet_r50-d8_769x769_80k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/hrnet/fcn_hr18_480x480_40k_pascal_context.py b/configs/hrnet/fcn_hr18_480x480_40k_pascal_context.py index 54a412e52c..5ff05aa595 100644 --- a/configs/hrnet/fcn_hr18_480x480_40k_pascal_context.py +++ b/configs/hrnet/fcn_hr18_480x480_40k_pascal_context.py @@ -2,6 +2,7 @@ '../_base_/models/fcn_hr18.py', '../_base_/datasets/pascal_context.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py' ] -model = dict(decode_head=dict(num_classes=60)) -test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) +model = dict( + decode_head=dict(num_classes=60), + test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320))) optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) diff --git a/configs/hrnet/fcn_hr18_480x480_80k_pascal_context.py b/configs/hrnet/fcn_hr18_480x480_80k_pascal_context.py index 2dfba8732b..cf315a4f0e 100644 --- a/configs/hrnet/fcn_hr18_480x480_80k_pascal_context.py +++ b/configs/hrnet/fcn_hr18_480x480_80k_pascal_context.py @@ -2,6 +2,7 @@ '../_base_/models/fcn_hr18.py', '../_base_/datasets/pascal_context.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py' ] -model = dict(decode_head=dict(num_classes=60)) -test_cfg = dict(mode='slide', crop_size=(480, 480), stride=(320, 320)) +model = dict( + decode_head=dict(num_classes=60), + test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320))) optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) diff --git a/configs/nonlocal_net/nonlocal_r50-d8_769x769_40k_cityscapes.py b/configs/nonlocal_net/nonlocal_r50-d8_769x769_40k_cityscapes.py index 3f0d47238f..75adef3248 100644 --- a/configs/nonlocal_net/nonlocal_r50-d8_769x769_40k_cityscapes.py +++ b/configs/nonlocal_net/nonlocal_r50-d8_769x769_40k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/nonlocal_net/nonlocal_r50-d8_769x769_80k_cityscapes.py b/configs/nonlocal_net/nonlocal_r50-d8_769x769_80k_cityscapes.py index 5d448c730a..a0726c293d 100644 --- a/configs/nonlocal_net/nonlocal_r50-d8_769x769_80k_cityscapes.py +++ b/configs/nonlocal_net/nonlocal_r50-d8_769x769_80k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/psanet/psanet_r50-d8_769x769_40k_cityscapes.py b/configs/psanet/psanet_r50-d8_769x769_40k_cityscapes.py index 2068667b0f..690f8b5ef3 100644 --- a/configs/psanet/psanet_r50-d8_769x769_40k_cityscapes.py +++ b/configs/psanet/psanet_r50-d8_769x769_40k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/psanet/psanet_r50-d8_769x769_80k_cityscapes.py b/configs/psanet/psanet_r50-d8_769x769_80k_cityscapes.py index 8745f5dbad..0966b4770c 100644 --- a/configs/psanet/psanet_r50-d8_769x769_80k_cityscapes.py +++ b/configs/psanet/psanet_r50-d8_769x769_80k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/pspnet/pspnet_r50-d8_769x769_40k_cityscapes.py b/configs/pspnet/pspnet_r50-d8_769x769_40k_cityscapes.py index e1026e0065..145cadb240 100644 --- a/configs/pspnet/pspnet_r50-d8_769x769_40k_cityscapes.py +++ b/configs/pspnet/pspnet_r50-d8_769x769_40k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/pspnet/pspnet_r50-d8_769x769_80k_cityscapes.py b/configs/pspnet/pspnet_r50-d8_769x769_80k_cityscapes.py index c1215c5c4a..23a81eb7ef 100644 --- a/configs/pspnet/pspnet_r50-d8_769x769_80k_cityscapes.py +++ b/configs/pspnet/pspnet_r50-d8_769x769_80k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/unet/deeplabv3_unet_s5-d16_128x128_40k_chase_db1.py b/configs/unet/deeplabv3_unet_s5-d16_128x128_40k_chase_db1.py index 615d241fec..c706cf3548 100644 --- a/configs/unet/deeplabv3_unet_s5-d16_128x128_40k_chase_db1.py +++ b/configs/unet/deeplabv3_unet_s5-d16_128x128_40k_chase_db1.py @@ -3,5 +3,5 @@ '../_base_/datasets/chase_db1.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py' ] -test_cfg = dict(crop_size=(128, 128), stride=(85, 85)) +model = dict(test_cfg=dict(crop_size=(128, 128), stride=(85, 85))) evaluation = dict(metric='mDice') diff --git a/configs/unet/deeplabv3_unet_s5-d16_128x128_40k_stare.py b/configs/unet/deeplabv3_unet_s5-d16_128x128_40k_stare.py index 286eebf445..0ef02dcc49 100644 --- a/configs/unet/deeplabv3_unet_s5-d16_128x128_40k_stare.py +++ b/configs/unet/deeplabv3_unet_s5-d16_128x128_40k_stare.py @@ -2,5 +2,5 @@ '../_base_/models/deeplabv3_unet_s5-d16.py', '../_base_/datasets/stare.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py' ] -test_cfg = dict(crop_size=(128, 128), stride=(85, 85)) +model = dict(test_cfg=dict(crop_size=(128, 128), stride=(85, 85))) evaluation = dict(metric='mDice') diff --git a/configs/unet/deeplabv3_unet_s5-d16_256x256_40k_hrf.py b/configs/unet/deeplabv3_unet_s5-d16_256x256_40k_hrf.py index 40a20537a3..118428bc44 100644 --- a/configs/unet/deeplabv3_unet_s5-d16_256x256_40k_hrf.py +++ b/configs/unet/deeplabv3_unet_s5-d16_256x256_40k_hrf.py @@ -2,5 +2,5 @@ '../_base_/models/deeplabv3_unet_s5-d16.py', '../_base_/datasets/hrf.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py' ] -test_cfg = dict(crop_size=(256, 256), stride=(170, 170)) +model = dict(test_cfg=dict(crop_size=(256, 256), stride=(170, 170))) evaluation = dict(metric='mDice') diff --git a/configs/unet/deeplabv3_unet_s5-d16_64x64_40k_drive.py b/configs/unet/deeplabv3_unet_s5-d16_64x64_40k_drive.py index 1ad6fd68c5..1f8862a0e8 100644 --- a/configs/unet/deeplabv3_unet_s5-d16_64x64_40k_drive.py +++ b/configs/unet/deeplabv3_unet_s5-d16_64x64_40k_drive.py @@ -2,5 +2,5 @@ '../_base_/models/deeplabv3_unet_s5-d16.py', '../_base_/datasets/drive.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py' ] -test_cfg = dict(crop_size=(64, 64), stride=(42, 42)) +model = dict(test_cfg=dict(crop_size=(64, 64), stride=(42, 42))) evaluation = dict(metric='mDice') diff --git a/configs/unet/fcn_unet_s5-d16_128x128_40k_chase_db1.py b/configs/unet/fcn_unet_s5-d16_128x128_40k_chase_db1.py index ff5b7bbc8e..2bc52d9629 100644 --- a/configs/unet/fcn_unet_s5-d16_128x128_40k_chase_db1.py +++ b/configs/unet/fcn_unet_s5-d16_128x128_40k_chase_db1.py @@ -2,5 +2,5 @@ '../_base_/models/fcn_unet_s5-d16.py', '../_base_/datasets/chase_db1.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py' ] -test_cfg = dict(crop_size=(128, 128), stride=(85, 85)) +model = dict(test_cfg=dict(crop_size=(128, 128), stride=(85, 85))) evaluation = dict(metric='mDice') diff --git a/configs/unet/fcn_unet_s5-d16_128x128_40k_stare.py b/configs/unet/fcn_unet_s5-d16_128x128_40k_stare.py index 64070a324a..5d836c61df 100644 --- a/configs/unet/fcn_unet_s5-d16_128x128_40k_stare.py +++ b/configs/unet/fcn_unet_s5-d16_128x128_40k_stare.py @@ -2,5 +2,5 @@ '../_base_/models/fcn_unet_s5-d16.py', '../_base_/datasets/stare.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py' ] -test_cfg = dict(crop_size=(128, 128), stride=(85, 85)) +model = dict(test_cfg=dict(crop_size=(128, 128), stride=(85, 85))) evaluation = dict(metric='mDice') diff --git a/configs/unet/fcn_unet_s5-d16_256x256_40k_hrf.py b/configs/unet/fcn_unet_s5-d16_256x256_40k_hrf.py index 8d74c0812d..be8eec7779 100644 --- a/configs/unet/fcn_unet_s5-d16_256x256_40k_hrf.py +++ b/configs/unet/fcn_unet_s5-d16_256x256_40k_hrf.py @@ -2,5 +2,5 @@ '../_base_/models/fcn_unet_s5-d16.py', '../_base_/datasets/hrf.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py' ] -test_cfg = dict(crop_size=(256, 256), stride=(170, 170)) +model = dict(test_cfg=dict(crop_size=(256, 256), stride=(170, 170))) evaluation = dict(metric='mDice') diff --git a/configs/unet/fcn_unet_s5-d16_64x64_40k_drive.py b/configs/unet/fcn_unet_s5-d16_64x64_40k_drive.py index c59a408e8c..80483ade4a 100644 --- a/configs/unet/fcn_unet_s5-d16_64x64_40k_drive.py +++ b/configs/unet/fcn_unet_s5-d16_64x64_40k_drive.py @@ -2,5 +2,5 @@ '../_base_/models/fcn_unet_s5-d16.py', '../_base_/datasets/drive.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py' ] -test_cfg = dict(crop_size=(64, 64), stride=(42, 42)) +model = dict(test_cfg=dict(crop_size=(64, 64), stride=(42, 42))) evaluation = dict(metric='mDice') diff --git a/configs/unet/pspnet_unet_s5-d16_128x128_40k_chase_db1.py b/configs/unet/pspnet_unet_s5-d16_128x128_40k_chase_db1.py index 46500ae811..b085a17d6b 100644 --- a/configs/unet/pspnet_unet_s5-d16_128x128_40k_chase_db1.py +++ b/configs/unet/pspnet_unet_s5-d16_128x128_40k_chase_db1.py @@ -3,5 +3,5 @@ '../_base_/datasets/chase_db1.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py' ] -test_cfg = dict(crop_size=(128, 128), stride=(85, 85)) +model = dict(test_cfg=dict(crop_size=(128, 128), stride=(85, 85))) evaluation = dict(metric='mDice') diff --git a/configs/unet/pspnet_unet_s5-d16_128x128_40k_stare.py b/configs/unet/pspnet_unet_s5-d16_128x128_40k_stare.py index 4830b2fdd1..9d729cea69 100644 --- a/configs/unet/pspnet_unet_s5-d16_128x128_40k_stare.py +++ b/configs/unet/pspnet_unet_s5-d16_128x128_40k_stare.py @@ -2,5 +2,5 @@ '../_base_/models/pspnet_unet_s5-d16.py', '../_base_/datasets/stare.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py' ] -test_cfg = dict(crop_size=(128, 128), stride=(85, 85)) +model = dict(test_cfg=dict(crop_size=(128, 128), stride=(85, 85))) evaluation = dict(metric='mDice') diff --git a/configs/unet/pspnet_unet_s5-d16_256x256_40k_hrf.py b/configs/unet/pspnet_unet_s5-d16_256x256_40k_hrf.py index dcfb7ec130..f57c9166b6 100644 --- a/configs/unet/pspnet_unet_s5-d16_256x256_40k_hrf.py +++ b/configs/unet/pspnet_unet_s5-d16_256x256_40k_hrf.py @@ -2,5 +2,5 @@ '../_base_/models/pspnet_unet_s5-d16.py', '../_base_/datasets/hrf.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py' ] -test_cfg = dict(crop_size=(256, 256), stride=(170, 170)) +model = dict(test_cfg=dict(crop_size=(256, 256), stride=(170, 170))) evaluation = dict(metric='mDice') diff --git a/configs/unet/pspnet_unet_s5-d16_64x64_40k_drive.py b/configs/unet/pspnet_unet_s5-d16_64x64_40k_drive.py index bf0b0b042a..7b5421ad68 100644 --- a/configs/unet/pspnet_unet_s5-d16_64x64_40k_drive.py +++ b/configs/unet/pspnet_unet_s5-d16_64x64_40k_drive.py @@ -2,5 +2,5 @@ '../_base_/models/pspnet_unet_s5-d16.py', '../_base_/datasets/drive.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py' ] -test_cfg = dict(crop_size=(64, 64), stride=(42, 42)) +model = dict(test_cfg=dict(crop_size=(64, 64), stride=(42, 42))) evaluation = dict(metric='mDice') diff --git a/configs/upernet/upernet_r50_769x769_40k_cityscapes.py b/configs/upernet/upernet_r50_769x769_40k_cityscapes.py index 590ab61b76..89b18aa284 100644 --- a/configs/upernet/upernet_r50_769x769_40k_cityscapes.py +++ b/configs/upernet/upernet_r50_769x769_40k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/configs/upernet/upernet_r50_769x769_80k_cityscapes.py b/configs/upernet/upernet_r50_769x769_80k_cityscapes.py index b3a6107581..29af98f2eb 100644 --- a/configs/upernet/upernet_r50_769x769_80k_cityscapes.py +++ b/configs/upernet/upernet_r50_769x769_80k_cityscapes.py @@ -5,5 +5,5 @@ ] model = dict( decode_head=dict(align_corners=True), - auxiliary_head=dict(align_corners=True)) -test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513)) + auxiliary_head=dict(align_corners=True), + test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513))) diff --git a/mmseg/apis/inference.py b/mmseg/apis/inference.py index 7cebac986d..20c20dccda 100644 --- a/mmseg/apis/inference.py +++ b/mmseg/apis/inference.py @@ -27,7 +27,8 @@ def init_segmentor(config, checkpoint=None, device='cuda:0'): raise TypeError('config must be a filename or Config object, ' 'but got {}'.format(type(config))) config.model.pretrained = None - model = build_segmentor(config.model, test_cfg=config.test_cfg) + config.model.train_cfg = None + model = build_segmentor(config.model, test_cfg=config.get('test_cfg')) if checkpoint is not None: checkpoint = load_checkpoint(model, checkpoint, map_location='cpu') model.CLASSES = checkpoint['meta']['CLASSES'] diff --git a/mmseg/models/builder.py b/mmseg/models/builder.py index f4b84dd60f..c487dcdd32 100644 --- a/mmseg/models/builder.py +++ b/mmseg/models/builder.py @@ -1,3 +1,5 @@ +import warnings + from mmcv.utils import Registry, build_from_cfg from torch import nn @@ -53,4 +55,12 @@ def build_loss(cfg): def build_segmentor(cfg, train_cfg=None, test_cfg=None): """Build segmentor.""" + if train_cfg is not None or test_cfg is not None: + warnings.warn( + 'train_cfg and test_cfg is deprecated, ' + 'please specify them in model', UserWarning) + assert cfg.get('train_cfg') is None or train_cfg is None, \ + 'train_cfg specified in both outer field and model field ' + assert cfg.get('test_cfg') is None or test_cfg is None, \ + 'test_cfg specified in both outer field and model field ' return build(cfg, SEGMENTORS, dict(train_cfg=train_cfg, test_cfg=test_cfg)) diff --git a/tests/test_config.py b/tests/test_config.py index 77a0035e55..b991fbfd31 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -45,8 +45,6 @@ def test_config_build_segmentor(): config_mod = Config.fromfile(config_fpath) config_mod.model - config_mod.train_cfg - config_mod.test_cfg print('Building segmentor, config_fpath = {!r}'.format(config_fpath)) # Remove pretrained keys to allow for testing in an offline environment @@ -54,10 +52,7 @@ def test_config_build_segmentor(): config_mod.model['pretrained'] = None print('building {}'.format(config_fname)) - segmentor = build_segmentor( - config_mod.model, - train_cfg=config_mod.train_cfg, - test_cfg=config_mod.test_cfg) + segmentor = build_segmentor(config_mod.model) assert segmentor is not None head_config = config_mod.model['decode_head'] diff --git a/tests/test_models/test_forward.py b/tests/test_models/test_forward.py index be797a74d0..ee8036246b 100644 --- a/tests/test_models/test_forward.py +++ b/tests/test_models/test_forward.py @@ -76,12 +76,9 @@ def _get_segmentor_cfg(fname): These are deep copied to allow for safe modification of parameters without influencing other tests. """ - import mmcv config = _get_config_module(fname) model = copy.deepcopy(config.model) - train_cfg = mmcv.Config(copy.deepcopy(config.train_cfg)) - test_cfg = mmcv.Config(copy.deepcopy(config.test_cfg)) - return model, train_cfg, test_cfg + return model def test_pspnet_forward(): @@ -212,12 +209,12 @@ def _convert_batchnorm(module): _check_input_dim) @patch('torch.distributed.get_world_size', get_world_size) def _test_encoder_decoder_forward(cfg_file): - model, train_cfg, test_cfg = _get_segmentor_cfg(cfg_file) + model = _get_segmentor_cfg(cfg_file) model['pretrained'] = None - test_cfg['mode'] = 'whole' + model['test_cfg']['mode'] = 'whole' from mmseg.models import build_segmentor - segmentor = build_segmentor(model, train_cfg=train_cfg, test_cfg=test_cfg) + segmentor = build_segmentor(model) if isinstance(segmentor.decode_head, nn.ModuleList): num_classes = segmentor.decode_head[-1].num_classes diff --git a/tests/test_models/test_segmentor.py b/tests/test_models/test_segmentor.py index 67f7884bc8..90d3bf6314 100644 --- a/tests/test_models/test_segmentor.py +++ b/tests/test_models/test_segmentor.py @@ -1,6 +1,6 @@ -import mmcv import numpy as np import torch +from mmcv import ConfigDict from torch import nn from mmseg.models import BACKBONES, HEADS, build_segmentor @@ -123,31 +123,33 @@ def _segmentor_forward_train_test(segmentor): def test_encoder_decoder(): # test 1 decode head, w.o. aux head - cfg = dict( + + cfg = ConfigDict( type='EncoderDecoder', backbone=dict(type='ExampleBackbone'), - decode_head=dict(type='ExampleDecodeHead')) - test_cfg = mmcv.Config(dict(mode='whole')) - segmentor = build_segmentor(cfg, train_cfg=None, test_cfg=test_cfg) + decode_head=dict(type='ExampleDecodeHead'), + train_cfg=None, + test_cfg=dict(mode='whole')) + segmentor = build_segmentor(cfg) _segmentor_forward_train_test(segmentor) # test slide mode - test_cfg = mmcv.Config(dict(mode='slide', crop_size=(3, 3), stride=(2, 2))) - segmentor = build_segmentor(cfg, train_cfg=None, test_cfg=test_cfg) + cfg.test_cfg = ConfigDict(mode='slide', crop_size=(3, 3), stride=(2, 2)) + segmentor = build_segmentor(cfg) _segmentor_forward_train_test(segmentor) # test 1 decode head, 1 aux head - cfg = dict( + cfg = ConfigDict( type='EncoderDecoder', backbone=dict(type='ExampleBackbone'), decode_head=dict(type='ExampleDecodeHead'), auxiliary_head=dict(type='ExampleDecodeHead')) - test_cfg = mmcv.Config(dict(mode='whole')) - segmentor = build_segmentor(cfg, train_cfg=None, test_cfg=test_cfg) + cfg.test_cfg = ConfigDict(mode='whole') + segmentor = build_segmentor(cfg) _segmentor_forward_train_test(segmentor) # test 1 decode head, 2 aux head - cfg = dict( + cfg = ConfigDict( type='EncoderDecoder', backbone=dict(type='ExampleBackbone'), decode_head=dict(type='ExampleDecodeHead'), @@ -155,15 +157,15 @@ def test_encoder_decoder(): dict(type='ExampleDecodeHead'), dict(type='ExampleDecodeHead') ]) - test_cfg = mmcv.Config(dict(mode='whole')) - segmentor = build_segmentor(cfg, train_cfg=None, test_cfg=test_cfg) + cfg.test_cfg = ConfigDict(mode='whole') + segmentor = build_segmentor(cfg) _segmentor_forward_train_test(segmentor) def test_cascade_encoder_decoder(): # test 1 decode head, w.o. aux head - cfg = dict( + cfg = ConfigDict( type='CascadeEncoderDecoder', num_stages=2, backbone=dict(type='ExampleBackbone'), @@ -171,17 +173,17 @@ def test_cascade_encoder_decoder(): dict(type='ExampleDecodeHead'), dict(type='ExampleCascadeDecodeHead') ]) - test_cfg = mmcv.Config(dict(mode='whole')) - segmentor = build_segmentor(cfg, train_cfg=None, test_cfg=test_cfg) + cfg.test_cfg = ConfigDict(mode='whole') + segmentor = build_segmentor(cfg) _segmentor_forward_train_test(segmentor) # test slide mode - test_cfg = mmcv.Config(dict(mode='slide', crop_size=(3, 3), stride=(2, 2))) - segmentor = build_segmentor(cfg, train_cfg=None, test_cfg=test_cfg) + cfg.test_cfg = ConfigDict(mode='slide', crop_size=(3, 3), stride=(2, 2)) + segmentor = build_segmentor(cfg) _segmentor_forward_train_test(segmentor) # test 1 decode head, 1 aux head - cfg = dict( + cfg = ConfigDict( type='CascadeEncoderDecoder', num_stages=2, backbone=dict(type='ExampleBackbone'), @@ -190,12 +192,12 @@ def test_cascade_encoder_decoder(): dict(type='ExampleCascadeDecodeHead') ], auxiliary_head=dict(type='ExampleDecodeHead')) - test_cfg = mmcv.Config(dict(mode='whole')) - segmentor = build_segmentor(cfg, train_cfg=None, test_cfg=test_cfg) + cfg.test_cfg = ConfigDict(mode='whole') + segmentor = build_segmentor(cfg) _segmentor_forward_train_test(segmentor) # test 1 decode head, 2 aux head - cfg = dict( + cfg = ConfigDict( type='CascadeEncoderDecoder', num_stages=2, backbone=dict(type='ExampleBackbone'), @@ -207,6 +209,6 @@ def test_cascade_encoder_decoder(): dict(type='ExampleDecodeHead'), dict(type='ExampleDecodeHead') ]) - test_cfg = mmcv.Config(dict(mode='whole')) - segmentor = build_segmentor(cfg, train_cfg=None, test_cfg=test_cfg) + cfg.test_cfg = ConfigDict(mode='whole') + segmentor = build_segmentor(cfg) _segmentor_forward_train_test(segmentor) diff --git a/tools/benchmark.py b/tools/benchmark.py index bcb0d9580f..cb0df3bdfa 100644 --- a/tools/benchmark.py +++ b/tools/benchmark.py @@ -40,7 +40,8 @@ def main(): shuffle=False) # build the model and load checkpoint - model = build_segmentor(cfg.model, train_cfg=None, test_cfg=cfg.test_cfg) + cfg.model.train_cfg = None + model = build_segmentor(cfg.model, test_cfg=cfg.get('test_cfg')) load_checkpoint(model, args.checkpoint, map_location='cpu') model = MMDataParallel(model, device_ids=[0]) diff --git a/tools/get_flops.py b/tools/get_flops.py index aef3055499..bc98c52525 100644 --- a/tools/get_flops.py +++ b/tools/get_flops.py @@ -33,7 +33,9 @@ def main(): cfg = Config.fromfile(args.config) cfg.model.pretrained = None model = build_segmentor( - cfg.model, train_cfg=cfg.train_cfg, test_cfg=cfg.test_cfg).cuda() + cfg.model, + train_cfg=cfg.get('train_cfg'), + test_cfg=cfg.get('test_cfg')).cuda() model.eval() if hasattr(model, 'forward_dummy'): diff --git a/tools/pytorch2onnx.py b/tools/pytorch2onnx.py index f22d4d3786..2ec9feb59a 100644 --- a/tools/pytorch2onnx.py +++ b/tools/pytorch2onnx.py @@ -181,8 +181,9 @@ def parse_args(): cfg.model.pretrained = None # build the model and load checkpoint + cfg.model.train_cfg = None segmentor = build_segmentor( - cfg.model, train_cfg=None, test_cfg=cfg.test_cfg) + cfg.model, train_cfg=None, test_cfg=cfg.get('test_cfg')) # convert SyncBN to BN segmentor = _convert_batchnorm(segmentor) diff --git a/tools/test.py b/tools/test.py index e47fcca68f..a106f04626 100644 --- a/tools/test.py +++ b/tools/test.py @@ -110,7 +110,8 @@ def main(): shuffle=False) # build the model and load checkpoint - model = build_segmentor(cfg.model, train_cfg=None, test_cfg=cfg.test_cfg) + cfg.model.train_cfg = None + model = build_segmentor(cfg.model, test_cfg=cfg.get('test_cfg')) checkpoint = load_checkpoint(model, args.checkpoint, map_location='cpu') model.CLASSES = checkpoint['meta']['CLASSES'] model.PALETTE = checkpoint['meta']['PALETTE'] diff --git a/tools/train.py b/tools/train.py index 8e3835ae00..51fe4065de 100644 --- a/tools/train.py +++ b/tools/train.py @@ -128,7 +128,9 @@ def main(): meta['exp_name'] = osp.basename(args.config) model = build_segmentor( - cfg.model, train_cfg=cfg.train_cfg, test_cfg=cfg.test_cfg) + cfg.model, + train_cfg=cfg.get('train_cfg'), + test_cfg=cfg.get('test_cfg')) logger.info(model)