diff --git a/configs/convnext/README.md b/configs/convnext/README.md index 931e002da..b407f8351 100644 --- a/configs/convnext/README.md +++ b/configs/convnext/README.md @@ -25,7 +25,7 @@ DOTA1.0 - ConvNeXt backbone needs to install [MMClassification](https://github.com/open-mmlab/mmclassification) first, which has abundant backbones for downstream tasks. ```shell -pip install mmcls>=0.22.0 +pip install "mmcls>=1.0.0rc0" ``` - The performance may be unstable according to mmdetection's experience. diff --git a/configs/convnext/rotated-retinanet-rbox-le90_convnext-tiny_fpn_kld-stable_adamw-1x_dota.py b/configs/convnext/rotated-retinanet-rbox-le90_convnext-tiny_fpn_kld-stable_adamw-1x_dota.py index b24a070ed..b92af8aaa 100644 --- a/configs/convnext/rotated-retinanet-rbox-le90_convnext-tiny_fpn_kld-stable_adamw-1x_dota.py +++ b/configs/convnext/rotated-retinanet-rbox-le90_convnext-tiny_fpn_kld-stable_adamw-1x_dota.py @@ -2,7 +2,7 @@ '../kld/rotated-retinanet-rbox-le90_r50_fpn_kld-stable_adamw-1x_dota.py' ] -# please install mmcls>=0.22.0 +# please install mmcls>=1.0.0rc0 # import mmcls.models to trigger register_module in mmcls custom_imports = dict(imports=['mmcls.models'], allow_failed_imports=False) checkpoint_file = 'https://download.openmmlab.com/mmclassification/v0/convnext/downstream/convnext-tiny_3rdparty_32xb128-noema_in1k_20220301-795e9634.pth' # noqa diff --git a/configs/kld/r3det-oc_r50_fpn_kld-stable_1x_dota.py b/configs/kld/r3det-oc_r50_fpn_kld-stable_1x_dota.py index 339ca69d8..bb2b503eb 100644 --- a/configs/kld/r3det-oc_r50_fpn_kld-stable_1x_dota.py +++ b/configs/kld/r3det-oc_r50_fpn_kld-stable_1x_dota.py @@ -2,7 +2,7 @@ angle_version = 'oc' model = dict( - bbox_head=dict( + bbox_head_init=dict( reg_decoded_bbox=True, loss_bbox=dict( _delete_=True, @@ -12,26 +12,28 @@ tau=1.0, sqrt=False, loss_weight=5.0)), - refine_heads=[ + bbox_head_refine=[ dict( - type='RotatedRetinaRefineHead', + type='R3RefineHead', num_classes=15, in_channels=256, stacked_convs=4, feat_channels=256, - assign_by_circumhbbox=None, + frm_cfg=dict( + type='FRM', feat_channels=256, strides=[8, 16, 32, 64, 128]), anchor_generator=dict( - type='PseudoAnchorGenerator', strides=[8, 16, 32, 64, 128]), + type='PseudoRotatedAnchorGenerator', + strides=[8, 16, 32, 64, 128]), bbox_coder=dict( - type='DeltaXYWHAOBBoxCoder', - angle_range=angle_version, + type='DeltaXYWHTRBBoxCoder', + angle_version=angle_version, norm_factor=None, edge_swap=False, proj_xy=False, target_means=(0.0, 0.0, 0.0, 0.0, 0.0), target_stds=(1.0, 1.0, 1.0, 1.0, 1.0)), loss_cls=dict( - type='FocalLoss', + type='mmdet.FocalLoss', use_sigmoid=True, gamma=2.0, alpha=0.25, diff --git a/configs/kld/r3det-oc_r50_fpn_kld_1x_dota.py b/configs/kld/r3det-oc_r50_fpn_kld_1x_dota.py index a677cedee..91e17fa6a 100644 --- a/configs/kld/r3det-oc_r50_fpn_kld_1x_dota.py +++ b/configs/kld/r3det-oc_r50_fpn_kld_1x_dota.py @@ -2,7 +2,7 @@ angle_version = 'oc' model = dict( - bbox_head=dict( + bbox_head_init=dict( reg_decoded_bbox=True, loss_bbox=dict( _delete_=True, @@ -11,26 +11,28 @@ fun='log1p', tau=1.0, loss_weight=1.0)), - refine_heads=[ + bbox_head_refine=[ dict( - type='RotatedRetinaRefineHead', + type='R3RefineHead', num_classes=15, in_channels=256, stacked_convs=4, feat_channels=256, - assign_by_circumhbbox=None, + frm_cfg=dict( + type='FRM', feat_channels=256, strides=[8, 16, 32, 64, 128]), anchor_generator=dict( - type='PseudoAnchorGenerator', strides=[8, 16, 32, 64, 128]), + type='PseudoRotatedAnchorGenerator', + strides=[8, 16, 32, 64, 128]), bbox_coder=dict( - type='DeltaXYWHAOBBoxCoder', - angle_range=angle_version, + type='DeltaXYWHTRBBoxCoder', + angle_version=angle_version, norm_factor=None, edge_swap=False, proj_xy=False, target_means=(0.0, 0.0, 0.0, 0.0, 0.0), target_stds=(1.0, 1.0, 1.0, 1.0, 1.0)), loss_cls=dict( - type='FocalLoss', + type='mmdet.FocalLoss', use_sigmoid=True, gamma=2.0, alpha=0.25, diff --git a/configs/kld/r3det-tiny-oc_r50_fpn_kld_1x_dota.py b/configs/kld/r3det-tiny-oc_r50_fpn_kld_1x_dota.py index 68cb75e0a..f456300e8 100644 --- a/configs/kld/r3det-tiny-oc_r50_fpn_kld_1x_dota.py +++ b/configs/kld/r3det-tiny-oc_r50_fpn_kld_1x_dota.py @@ -2,7 +2,7 @@ angle_version = 'oc' model = dict( - bbox_head=dict( + bbox_head_init=dict( reg_decoded_bbox=True, loss_bbox=dict( _delete_=True, @@ -11,26 +11,28 @@ fun='log1p', tau=1.0, loss_weight=1.0)), - refine_heads=[ + bbox_head_refine=[ dict( - type='RotatedRetinaRefineHead', + type='R3RefineHead', num_classes=15, in_channels=256, stacked_convs=2, feat_channels=256, - assign_by_circumhbbox=None, + frm_cfg=dict( + type='FRM', feat_channels=256, strides=[8, 16, 32, 64, 128]), anchor_generator=dict( - type='PseudoAnchorGenerator', strides=[8, 16, 32, 64, 128]), + type='PseudoRotatedAnchorGenerator', + strides=[8, 16, 32, 64, 128]), bbox_coder=dict( - type='DeltaXYWHAOBBoxCoder', - angle_range=angle_version, + type='DeltaXYWHTRBBoxCoder', + angle_version=angle_version, norm_factor=None, edge_swap=False, proj_xy=False, target_means=(0.0, 0.0, 0.0, 0.0, 0.0), target_stds=(1.0, 1.0, 1.0, 1.0, 1.0)), loss_cls=dict( - type='FocalLoss', + type='mmdet.FocalLoss', use_sigmoid=True, gamma=2.0, alpha=0.25, diff --git a/configs/kld/rotated-retinanet-hbox-oc_r50_fpn_kld-stable_1x_dota.py b/configs/kld/rotated-retinanet-hbox-oc_r50_fpn_kld-stable_1x_dota.py index 55229632c..a0b55e93f 100644 --- a/configs/kld/rotated-retinanet-hbox-oc_r50_fpn_kld-stable_1x_dota.py +++ b/configs/kld/rotated-retinanet-hbox-oc_r50_fpn_kld-stable_1x_dota.py @@ -1,4 +1,4 @@ -_base_ = '../rotated_retinanet/rotated_retinanet-hbox-oc_r50_fpn_1x_dota.py' +_base_ = '../rotated_retinanet/rotated-retinanet-hbox-oc_r50_fpn_1x_dota.py' model = dict( bbox_head=dict( diff --git a/configs/kld/rotated-retinanet-rbox-le90_r50_fpn_kld-stable_adamw-1x_dota.py b/configs/kld/rotated-retinanet-rbox-le90_r50_fpn_kld-stable_adamw-1x_dota.py index 9409b33f1..d5a6c4a09 100644 --- a/configs/kld/rotated-retinanet-rbox-le90_r50_fpn_kld-stable_adamw-1x_dota.py +++ b/configs/kld/rotated-retinanet-rbox-le90_r50_fpn_kld-stable_adamw-1x_dota.py @@ -1,4 +1,4 @@ -_base_ = './rotated_retinanet-rbox-le90_r50_fpn_kld-stable_1x_dota.py' +_base_ = './rotated-retinanet-rbox-le90_r50_fpn_kld-stable_1x_dota.py' optim_wrapper = dict( optimizer=dict( diff --git a/configs/oriented_rcnn/oriented-rcnn-le90_r50_fpn_amp-1x_dota.py b/configs/oriented_rcnn/oriented-rcnn-le90_r50_fpn_amp-1x_dota.py index 0c06452d3..4888d77ea 100644 --- a/configs/oriented_rcnn/oriented-rcnn-le90_r50_fpn_amp-1x_dota.py +++ b/configs/oriented_rcnn/oriented-rcnn-le90_r50_fpn_amp-1x_dota.py @@ -1,3 +1,3 @@ _base_ = './oriented-rcnn-le90_r50_fpn_1x_dota.py' -optim_wrapper = dict(type='AmpOptimWrapper', loss_scale='dynamic') +optim_wrapper = dict(type='AmpOptimWrapper') diff --git a/configs/oriented_rcnn/oriented-rcnn-le90_swin-tiny_fpn_1x_dota.py b/configs/oriented_rcnn/oriented-rcnn-le90_swin-tiny_fpn_1x_dota.py index 4411ba1e6..daa46490d 100644 --- a/configs/oriented_rcnn/oriented-rcnn-le90_swin-tiny_fpn_1x_dota.py +++ b/configs/oriented_rcnn/oriented-rcnn-le90_swin-tiny_fpn_1x_dota.py @@ -5,7 +5,7 @@ model = dict( backbone=dict( _delete_=True, - type='SwinTransformer', + type='mmdet.SwinTransformer', embed_dims=96, depths=depths, num_heads=[3, 6, 12, 24], diff --git a/configs/redet/README.md b/configs/redet/README.md index 49413edac..3fe8300df 100644 --- a/configs/redet/README.md +++ b/configs/redet/README.md @@ -34,6 +34,7 @@ Notes: - `MS` means multiple scale image split. - `RR` means random rotation. - Please download pretrained weight of ReResNet from [ReDet](https://github.com/csuhan/ReDet), and put it on `work_dirs/pretrain`. BTW, it is normal for `missing keys in source state_dict: xxx.filter ` to appear in the log. Don't worry! +- Please use distributed training, there are some bug when use `train.py`. ## Citation diff --git a/configs/redet/redet-le90_re50_refpn_amp-1x_dota.py b/configs/redet/redet-le90_re50_refpn_amp-1x_dota.py index 943427c1d..1e2f483f4 100644 --- a/configs/redet/redet-le90_re50_refpn_amp-1x_dota.py +++ b/configs/redet/redet-le90_re50_refpn_amp-1x_dota.py @@ -1,3 +1,3 @@ _base_ = './redet-le90_re50_refpn_1x_dota.py' -optim_wrapper = dict(type='AmpOptimWrapper', loss_scale='dynamic') +optim_wrapper = dict(type='AmpOptimWrapper') diff --git a/configs/roi_trans/roi-trans-le90_r50_fpn_amp-1x_dota.py b/configs/roi_trans/roi-trans-le90_r50_fpn_amp-1x_dota.py index 8b5cb38d6..d1fc6f5e5 100644 --- a/configs/roi_trans/roi-trans-le90_r50_fpn_amp-1x_dota.py +++ b/configs/roi_trans/roi-trans-le90_r50_fpn_amp-1x_dota.py @@ -1,3 +1,3 @@ _base_ = './roi-trans-le90_r50_fpn_1x_dota.py' -optim_wrapper = dict(type='AmpOptimWrapper', loss_scale='dynamic') +optim_wrapper = dict(type='AmpOptimWrapper') diff --git a/configs/roi_trans/roi-trans-le90_swin-tiny_fpn_1x_dota.py b/configs/roi_trans/roi-trans-le90_swin-tiny_fpn_1x_dota.py index d3f39c74e..7ea31993e 100644 --- a/configs/roi_trans/roi-trans-le90_swin-tiny_fpn_1x_dota.py +++ b/configs/roi_trans/roi-trans-le90_swin-tiny_fpn_1x_dota.py @@ -6,7 +6,7 @@ model = dict( backbone=dict( _delete_=True, - type='SwinTransformer', + type='mmet.SwinTransformer', embed_dims=96, depths=depths, num_heads=[3, 6, 12, 24], diff --git a/configs/rotated_reppoints/metafile.yml b/configs/rotated_reppoints/metafile.yml index d1433b75e..1b2a520aa 100644 --- a/configs/rotated_reppoints/metafile.yml +++ b/configs/rotated_reppoints/metafile.yml @@ -14,9 +14,9 @@ Collections: README: configs/cfa/README.md Models: - - Name: rotated_reppoints_r50_fpn_1x_dota_oc + - Name: rotated-reppoints-qbox_r50_fpn_1x_dota In Collection: rotated_reppoints - Config: configs/rotated_reppoints/rotated_reppoints_r50_fpn_1x_dota_oc.py + Config: configs/rotated_reppoints/rotated-reppoints-qbox_r50_fpn_1x_dota.py Metadata: Training Data: DOTAv1.0 Results: diff --git a/configs/rotated_retinanet/rotated-retinanet-rbox-le90_r50_fpn_amp-1x_dota.py b/configs/rotated_retinanet/rotated-retinanet-rbox-le90_r50_fpn_amp-1x_dota.py index 039fc9279..a24d3a03f 100644 --- a/configs/rotated_retinanet/rotated-retinanet-rbox-le90_r50_fpn_amp-1x_dota.py +++ b/configs/rotated_retinanet/rotated-retinanet-rbox-le90_r50_fpn_amp-1x_dota.py @@ -1,3 +1,3 @@ _base_ = ['./rotated-retinanet-rbox-le90_r50_fpn_1x_dota.py'] -optim_wrapper = dict(type='AmpOptimWrapper', loss_scale='dynamic') +optim_wrapper = dict(type='AmpOptimWrapper') diff --git a/mmrotate/models/backbones/re_resnet.py b/mmrotate/models/backbones/re_resnet.py index 105446bf0..083253fae 100644 --- a/mmrotate/models/backbones/re_resnet.py +++ b/mmrotate/models/backbones/re_resnet.py @@ -490,7 +490,7 @@ def __init__(self, zero_init_residual: bool = True, init_cfg: OptMultiConfig = None) -> None: super().__init__(init_cfg=init_cfg) - self.in_type = build_enn_trivial_feature(3) + self.in_type = build_enn_trivial_feature(in_channels) if depth not in self.arch_settings: raise KeyError(f'invalid depth {depth} for resnet') diff --git a/mmrotate/models/roi_heads/roi_extractors/rotate_single_level_roi_extractor.py b/mmrotate/models/roi_heads/roi_extractors/rotate_single_level_roi_extractor.py index d07ca8151..cc06dc98b 100644 --- a/mmrotate/models/roi_heads/roi_extractors/rotate_single_level_roi_extractor.py +++ b/mmrotate/models/roi_heads/roi_extractors/rotate_single_level_roi_extractor.py @@ -97,6 +97,7 @@ def forward(self, feats, rois, roi_scale_factor=None): Returns: torch.Tensor: Scaled RoI features. """ + rois = rois.type_as(feats[0]) from mmrotate import digit_version, mmcv_version if isinstance(self.roi_layers[0], ops.RiRoIAlignRotated ) or mmcv_version == digit_version('1.4.5'): diff --git a/mmrotate/structures/bbox/rotated_boxes.py b/mmrotate/structures/bbox/rotated_boxes.py index 13e2915f2..8280684f1 100644 --- a/mmrotate/structures/bbox/rotated_boxes.py +++ b/mmrotate/structures/bbox/rotated_boxes.py @@ -413,10 +413,10 @@ def overlaps(boxes1: BaseBoxes, Returns: Tensor: shape (m, n) if ``is_aligned`` is False else shape (m,) """ - from ..iou_calculators import rbox_overlaps + from mmrotate.structures.bbox import rbbox_overlaps boxes1 = boxes1.convert_to('rbox') boxes2 = boxes2.convert_to('rbox') - return rbox_overlaps( + return rbbox_overlaps( boxes1.tensor, boxes2.tensor, mode=mode,