From 6ff97d33ccac40daecdf3c3970e5a46231c0b555 Mon Sep 17 00:00:00 2001 From: zytx121 <592267829@qq.com> Date: Tue, 1 Nov 2022 21:50:49 +0800 Subject: [PATCH 1/6] init --- tools/data/README.md | 2 ++ tools/data/rsdd/README.md | 39 ++++++++++++++++++++++++++++++++++++++ tools/data/srsdd/README.md | 38 +++++++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 tools/data/rsdd/README.md create mode 100644 tools/data/srsdd/README.md diff --git a/tools/data/README.md b/tools/data/README.md index e7578f9de..911acee5e 100644 --- a/tools/data/README.md +++ b/tools/data/README.md @@ -9,3 +9,5 @@ Datasets supported in MMRotate: - [SSDD Dataset](ssdd/README.md) - [HRSC Dataset](hrsc/README.md) - [HRSID Dataset](hrsid/README.md) +- [SRSDD Dataset](srsdd/README.md) +- [RSDD Dataset](rsdd/README.md) diff --git a/tools/data/rsdd/README.md b/tools/data/rsdd/README.md new file mode 100644 index 000000000..f283304e0 --- /dev/null +++ b/tools/data/rsdd/README.md @@ -0,0 +1,39 @@ +# Preparing RSDD Dataset + + + +```bibtex +@ARTICLE{RSDD2022, +author = {C. Xu, H. Su, J. Li, Y. Liu, L. Yao, L. Gao, W. Yan and T. Wang}, +title = {RSDD-SAR: Rotated Ship Detection Dataset in SAR Images}, +journal = {Journal of Radars}, +month = {Sep.}, +year = {2022}, +volume={11}, +number={R22007}, +pages={581}, +} +``` + +## Download RSDD dataset + +The RSDD dataset can be downloaded from [here:0518](https://pan.baidu.com/s/1_uezALB6eZ7DiPIozFoGJQ). + +The data structure is as follows: + +```none +mmrotate +├── mmrotate +├── tools +├── configs +├── data +│ ├── rsdd +│ │ ├── Annotations +│ │ ├── ImageSets +│ │ ├── JPEGImages +│ │ ├── JPEGValidation +``` + +## Change base config + +Please change `data_root` in `configs/_base_/datasets/rsdd.py` to `data/rsdd/`. diff --git a/tools/data/srsdd/README.md b/tools/data/srsdd/README.md new file mode 100644 index 000000000..b6de5be8a --- /dev/null +++ b/tools/data/srsdd/README.md @@ -0,0 +1,38 @@ +# Preparing SRSDD Dataset + + + +```bibtex +@ARTICLE{SRSDD2021, +author = {S. Lei, D. Lu and X. Qiu}, +title = {SRSDD-v1.0: A high-resolution SAR rotation ship +detection dataset}, +journal = {Remote Senseing}, +month = {Dec.}, +year = {2021}, +volume={13}, +number={24}, +pages={5104}, +} +``` + +## Download SRSDD dataset + +The SRSDD dataset can be downloaded from [here:0518](https://pan.baidu.com/s/1_uezALB6eZ7DiPIozFoGJQ). + +The data structure is as follows: + +```none +mmrotate +├── mmrotate +├── tools +├── configs +├── data +│ ├── srsdd +│ │ ├── train +│ │ ├── test +``` + +## Change base config + +Please change `data_root` in `configs/_base_/datasets/srsdd.py` to `data/srsdd/`. From ef07ef23dbc44d0d0d42c3c23976ccd0870a894d Mon Sep 17 00:00:00 2001 From: zytx121 <592267829@qq.com> Date: Tue, 1 Nov 2022 21:50:49 +0800 Subject: [PATCH 2/6] update --- configs/_base_/datasets/hrsid.py | 109 +++++++++----- configs/_base_/datasets/rsdd.py | 80 ++++++++++ configs/_base_/datasets/srsdd.py | 81 ++++++++++ configs/_base_/datasets/ssdd.py | 109 +++++++++----- .../oriented-rcnn-le90_r50_fpn_6x_hrsid.py | 97 +++++------- .../oriented-rcnn-le90_r50_fpn_6x_rsdd.py | 141 ++++++++++++++++++ .../oriented-rcnn-le90_r50_fpn_6x_srsdd.py | 141 ++++++++++++++++++ .../oriented-rcnn-le90_r50_fpn_6x_ssdd.py | 97 +++++------- mmrotate/datasets/__init__.py | 3 +- mmrotate/datasets/sar.py | 12 -- tools/data/hrsid/README.md | 5 +- 11 files changed, 668 insertions(+), 207 deletions(-) create mode 100644 configs/_base_/datasets/rsdd.py create mode 100644 configs/_base_/datasets/srsdd.py create mode 100644 configs/oriented_rcnn/oriented-rcnn-le90_r50_fpn_6x_rsdd.py create mode 100644 configs/oriented_rcnn/oriented-rcnn-le90_r50_fpn_6x_srsdd.py delete mode 100644 mmrotate/datasets/sar.py diff --git a/configs/_base_/datasets/hrsid.py b/configs/_base_/datasets/hrsid.py index 584b870f1..17bc8d9d8 100644 --- a/configs/_base_/datasets/hrsid.py +++ b/configs/_base_/datasets/hrsid.py @@ -1,47 +1,80 @@ # dataset settings -dataset_type = 'SARDataset' +dataset_type = 'mmdet.CocoDataset' data_root = 'data/hrsid/' -img_norm_cfg = dict( - mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) +file_client_args = dict(backend='disk') + train_pipeline = [ - dict(type='LoadImageFromFile'), - dict(type='LoadAnnotations', with_bbox=True), - dict(type='RResize', img_scale=(800, 800)), - dict(type='RRandomFlip', flip_ratio=0.5), - dict(type='Normalize', **img_norm_cfg), - dict(type='Pad', size_divisor=32), - dict(type='DefaultFormatBundle'), - dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']) + dict(type='mmdet.LoadImageFromFile', file_client_args=file_client_args), + dict( + type='mmdet.LoadAnnotations', + with_bbox=True, + with_mask=True, + poly2mask=False), + dict(type='ConvertMask2BoxType', box_type='rbox'), + dict(type='mmdet.Resize', scale=(800, 800), keep_ratio=True), + dict( + type='mmdet.RandomFlip', + prob=0.75, + direction=['horizontal', 'vertical', 'diagonal']), + dict(type='mmdet.PackDetInputs') +] +val_pipeline = [ + dict(type='mmdet.LoadImageFromFile', file_client_args=file_client_args), + dict(type='mmdet.Resize', scale=(800, 800), keep_ratio=True), + # avoid bboxes being resized + dict( + type='mmdet.LoadAnnotations', + with_bbox=True, + with_mask=True, + poly2mask=False), + dict(type='ConvertMask2BoxType', box_type='qbox'), + dict( + type='mmdet.PackDetInputs', + meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', + 'scale_factor', 'instances')) ] test_pipeline = [ - dict(type='LoadImageFromFile'), + dict(type='mmdet.LoadImageFromFile', file_client_args=file_client_args), + dict(type='mmdet.Resize', scale=(800, 800), keep_ratio=True), + # avoid bboxes being resized dict( - type='MultiScaleFlipAug', - img_scale=(800, 800), - flip=False, - transforms=[ - dict(type='RResize'), - dict(type='Normalize', **img_norm_cfg), - dict(type='Pad', size_divisor=32), - dict(type='DefaultFormatBundle'), - dict(type='Collect', keys=['img']) - ]) + type='mmdet.PackDetInputs', + meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', + 'scale_factor')) ] -data = dict( - samples_per_gpu=2, - workers_per_gpu=2, - train=dict( - type=dataset_type, - ann_file=data_root + 'trainsplit/labelTxt/', - img_prefix=data_root + 'trainsplit/images/', - pipeline=train_pipeline), - val=dict( + +metainfo = dict(CLASSES=('ship', )) + +train_dataloader = dict( + batch_size=2, + num_workers=2, + persistent_workers=True, + sampler=dict(type='DefaultSampler', shuffle=True), + batch_sampler=None, + dataset=dict( type=dataset_type, - ann_file=data_root + 'testsplit/inshore/labelTxt/', - img_prefix=data_root + 'testsplit/inshore/images/', - pipeline=test_pipeline), - test=dict( + metainfo=metainfo, + data_root=data_root, + ann_file='train/train.json', + data_prefix=dict(img='train/images/'), + filter_cfg=dict(filter_empty_gt=True), + pipeline=train_pipeline)) +val_dataloader = dict( + batch_size=1, + num_workers=2, + persistent_workers=True, + drop_last=False, + sampler=dict(type='DefaultSampler', shuffle=False), + dataset=dict( type=dataset_type, - ann_file=data_root + 'testsplit/offshore/labelTxt/', - img_prefix=data_root + 'testsplit/offshore/images/', - pipeline=test_pipeline)) + metainfo=metainfo, + data_root=data_root, + ann_file='test/test.json', + data_prefix=dict(img='test/images/'), + test_mode=True, + pipeline=val_pipeline)) +test_dataloader = val_dataloader + +val_evaluator = dict(type='RotatedCocoMetric', metric='bbox') + +test_evaluator = val_evaluator diff --git a/configs/_base_/datasets/rsdd.py b/configs/_base_/datasets/rsdd.py new file mode 100644 index 000000000..2764d22c5 --- /dev/null +++ b/configs/_base_/datasets/rsdd.py @@ -0,0 +1,80 @@ +# dataset settings +dataset_type = 'mmdet.CocoDataset' +data_root = 'data/rsdd/' +file_client_args = dict(backend='disk') + +train_pipeline = [ + dict(type='mmdet.LoadImageFromFile', file_client_args=file_client_args), + dict( + type='mmdet.LoadAnnotations', + with_bbox=True, + with_mask=True, + poly2mask=False), + dict(type='ConvertMask2BoxType', box_type='rbox'), + dict(type='mmdet.Resize', scale=(512, 512), keep_ratio=True), + dict( + type='mmdet.RandomFlip', + prob=0.75, + direction=['horizontal', 'vertical', 'diagonal']), + dict(type='mmdet.PackDetInputs') +] +val_pipeline = [ + dict(type='mmdet.LoadImageFromFile', file_client_args=file_client_args), + dict(type='mmdet.Resize', scale=(512, 512), keep_ratio=True), + # avoid bboxes being resized + dict( + type='mmdet.LoadAnnotations', + with_bbox=True, + with_mask=True, + poly2mask=False), + dict(type='ConvertMask2BoxType', box_type='qbox'), + dict( + type='mmdet.PackDetInputs', + meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', + 'scale_factor', 'instances')) +] +test_pipeline = [ + dict(type='mmdet.LoadImageFromFile', file_client_args=file_client_args), + dict(type='mmdet.Resize', scale=(512, 512), keep_ratio=True), + # avoid bboxes being resized + dict( + type='mmdet.PackDetInputs', + meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', + 'scale_factor')) +] + +metainfo = dict(CLASSES=('ship',)) + +train_dataloader = dict( + batch_size=2, + num_workers=2, + persistent_workers=True, + sampler=dict(type='DefaultSampler', shuffle=True), + batch_sampler=None, + dataset=dict( + type=dataset_type, + metainfo=metainfo, + data_root=data_root, + ann_file='ImageSets/train.json', + data_prefix=dict(img='JPEGImages/'), + filter_cfg=dict(filter_empty_gt=True), + pipeline=train_pipeline)) +val_dataloader = dict( + batch_size=1, + num_workers=2, + persistent_workers=True, + drop_last=False, + sampler=dict(type='DefaultSampler', shuffle=False), + dataset=dict( + type=dataset_type, + metainfo=metainfo, + data_root=data_root, + ann_file='ImageSets/test.json', + data_prefix=dict(img='JPEGImages/'), + test_mode=True, + pipeline=val_pipeline)) +test_dataloader = val_dataloader + +val_evaluator = dict(type='RotatedCocoMetric', metric='bbox') + +test_evaluator = val_evaluator diff --git a/configs/_base_/datasets/srsdd.py b/configs/_base_/datasets/srsdd.py new file mode 100644 index 000000000..26ae5ec80 --- /dev/null +++ b/configs/_base_/datasets/srsdd.py @@ -0,0 +1,81 @@ +# dataset settings +dataset_type = 'mmdet.CocoDataset' +data_root = 'data/srsdd/' +file_client_args = dict(backend='disk') + +train_pipeline = [ + dict(type='mmdet.LoadImageFromFile', file_client_args=file_client_args), + dict( + type='mmdet.LoadAnnotations', + with_bbox=True, + with_mask=True, + poly2mask=False), + dict(type='ConvertMask2BoxType', box_type='rbox'), + dict(type='mmdet.Resize', scale=(1024, 1024), keep_ratio=True), + dict( + type='mmdet.RandomFlip', + prob=0.75, + direction=['horizontal', 'vertical', 'diagonal']), + dict(type='mmdet.PackDetInputs') +] +val_pipeline = [ + dict(type='mmdet.LoadImageFromFile', file_client_args=file_client_args), + dict(type='mmdet.Resize', scale=(1024, 1024), keep_ratio=True), + # avoid bboxes being resized + dict( + type='mmdet.LoadAnnotations', + with_bbox=True, + with_mask=True, + poly2mask=False), + dict(type='ConvertMask2BoxType', box_type='qbox'), + dict( + type='mmdet.PackDetInputs', + meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', + 'scale_factor', 'instances')) +] +test_pipeline = [ + dict(type='mmdet.LoadImageFromFile', file_client_args=file_client_args), + dict(type='mmdet.Resize', scale=(1024, 1024), keep_ratio=True), + # avoid bboxes being resized + dict( + type='mmdet.PackDetInputs', + meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', + 'scale_factor')) +] + +metainfo = dict(CLASSES=('Container', 'Dredger', 'LawEnforce', 'Cell-Container', + 'ore-oil', 'Fishing')) + +train_dataloader = dict( + batch_size=2, + num_workers=2, + persistent_workers=True, + sampler=dict(type='DefaultSampler', shuffle=True), + batch_sampler=None, + dataset=dict( + type=dataset_type, + metainfo=metainfo, + data_root=data_root, + ann_file='train/train.json', + data_prefix=dict(img='train/images/'), + filter_cfg=dict(filter_empty_gt=True), + pipeline=train_pipeline)) +val_dataloader = dict( + batch_size=1, + num_workers=2, + persistent_workers=True, + drop_last=False, + sampler=dict(type='DefaultSampler', shuffle=False), + dataset=dict( + type=dataset_type, + metainfo=metainfo, + data_root=data_root, + ann_file='test/test.json', + data_prefix=dict(img='test/images/'), + test_mode=True, + pipeline=val_pipeline)) +test_dataloader = val_dataloader + +val_evaluator = dict(type='RotatedCocoMetric', metric='bbox') + +test_evaluator = val_evaluator diff --git a/configs/_base_/datasets/ssdd.py b/configs/_base_/datasets/ssdd.py index 49b2b9a07..6ed2e5821 100644 --- a/configs/_base_/datasets/ssdd.py +++ b/configs/_base_/datasets/ssdd.py @@ -1,47 +1,80 @@ # dataset settings -dataset_type = 'SARDataset' +dataset_type = 'mmdet.CocoDataset' data_root = 'data/ssdd/' -img_norm_cfg = dict( - mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) +file_client_args = dict(backend='disk') + train_pipeline = [ - dict(type='LoadImageFromFile'), - dict(type='LoadAnnotations', with_bbox=True), - dict(type='RResize', img_scale=(608, 608)), - dict(type='RRandomFlip', flip_ratio=0.5), - dict(type='Normalize', **img_norm_cfg), - dict(type='Pad', size_divisor=32), - dict(type='DefaultFormatBundle'), - dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']) + dict(type='mmdet.LoadImageFromFile', file_client_args=file_client_args), + dict( + type='mmdet.LoadAnnotations', + with_bbox=True, + with_mask=True, + poly2mask=False), + dict(type='ConvertMask2BoxType', box_type='rbox'), + dict(type='mmdet.Resize', scale=(512, 512), keep_ratio=True), + dict( + type='mmdet.RandomFlip', + prob=0.75, + direction=['horizontal', 'vertical', 'diagonal']), + dict(type='mmdet.PackDetInputs') +] +val_pipeline = [ + dict(type='mmdet.LoadImageFromFile', file_client_args=file_client_args), + dict(type='mmdet.Resize', scale=(512, 512), keep_ratio=True), + # avoid bboxes being resized + dict( + type='mmdet.LoadAnnotations', + with_bbox=True, + with_mask=True, + poly2mask=False), + dict(type='ConvertMask2BoxType', box_type='qbox'), + dict( + type='mmdet.PackDetInputs', + meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', + 'scale_factor', 'instances')) ] test_pipeline = [ - dict(type='LoadImageFromFile'), + dict(type='mmdet.LoadImageFromFile', file_client_args=file_client_args), + dict(type='mmdet.Resize', scale=(512, 512), keep_ratio=True), + # avoid bboxes being resized dict( - type='MultiScaleFlipAug', - img_scale=(608, 608), - flip=False, - transforms=[ - dict(type='RResize'), - dict(type='Normalize', **img_norm_cfg), - dict(type='Pad', size_divisor=32), - dict(type='DefaultFormatBundle'), - dict(type='Collect', keys=['img']) - ]) + type='mmdet.PackDetInputs', + meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', + 'scale_factor')) ] -data = dict( - samples_per_gpu=2, - workers_per_gpu=2, - train=dict( - type=dataset_type, - ann_file=data_root + 'train/labelTxt/', - img_prefix=data_root + 'train/images/', - pipeline=train_pipeline), - val=dict( + +metainfo = dict(CLASSES=('ship', )) + +train_dataloader = dict( + batch_size=2, + num_workers=2, + persistent_workers=True, + sampler=dict(type='DefaultSampler', shuffle=True), + batch_sampler=None, + dataset=dict( type=dataset_type, - ann_file=data_root + 'test/inshore/labelTxt/', - img_prefix=data_root + 'test/inshore/images/', - pipeline=test_pipeline), - test=dict( + metainfo=metainfo, + data_root=data_root, + ann_file='train/train.json', + data_prefix=dict(img='train/images/'), + filter_cfg=dict(filter_empty_gt=True), + pipeline=train_pipeline)) +val_dataloader = dict( + batch_size=1, + num_workers=2, + persistent_workers=True, + drop_last=False, + sampler=dict(type='DefaultSampler', shuffle=False), + dataset=dict( type=dataset_type, - ann_file=data_root + 'test/offshore/labelTxt/', - img_prefix=data_root + 'test/offshore/images/', - pipeline=test_pipeline)) + metainfo=metainfo, + data_root=data_root, + ann_file='test/test.json', + data_prefix=dict(img='test/images/'), + test_mode=True, + pipeline=val_pipeline)) +test_dataloader = val_dataloader + +val_evaluator = dict(type='RotatedCocoMetric', metric='bbox') + +test_evaluator = val_evaluator diff --git a/configs/oriented_rcnn/oriented-rcnn-le90_r50_fpn_6x_hrsid.py b/configs/oriented_rcnn/oriented-rcnn-le90_r50_fpn_6x_hrsid.py index d63a2354b..e344b8383 100644 --- a/configs/oriented_rcnn/oriented-rcnn-le90_r50_fpn_6x_hrsid.py +++ b/configs/oriented_rcnn/oriented-rcnn-le90_r50_fpn_6x_hrsid.py @@ -1,23 +1,30 @@ _base_ = [ - '../_base_/datasets/hrsid.py', '../_base_/schedules/schedule_3x.py', + '../_base_/datasets/hrsid.py', '../_base_/schedules/schedule_6x.py', '../_base_/default_runtime.py' ] angle_version = 'le90' model = dict( - type='OrientedRCNN', + type='mmdet.FasterRCNN', + data_preprocessor=dict( + type='mmdet.DetDataPreprocessor', + mean=[123.675, 116.28, 103.53], + std=[58.395, 57.12, 57.375], + bgr_to_rgb=True, + pad_size_divisor=32, + boxtype2tensor=False), backbone=dict( - type='ResNet', + type='mmdet.ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), - frozen_stages=-1, + frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), norm_eval=True, style='pytorch', init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')), neck=dict( - type='FPN', + type='mmdet.FPN', in_channels=[256, 512, 1024, 2048], out_channels=256, num_outs=5), @@ -25,23 +32,25 @@ type='OrientedRPNHead', in_channels=256, feat_channels=256, - version=angle_version, anchor_generator=dict( - type='AnchorGenerator', + type='mmdet.AnchorGenerator', scales=[8], ratios=[0.5, 1.0, 2.0], - strides=[4, 8, 16, 32, 64]), + strides=[4, 8, 16, 32, 64], + use_box_type=True), bbox_coder=dict( type='MidpointOffsetCoder', - angle_range=angle_version, + angle_version=angle_version, target_means=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], target_stds=[1.0, 1.0, 1.0, 1.0, 0.5, 0.5]), loss_cls=dict( - type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0), + type='mmdet.CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0), loss_bbox=dict( - type='SmoothL1Loss', beta=0.1111111111111111, loss_weight=1.0)), + type='mmdet.SmoothL1Loss', + beta=0.1111111111111111, + loss_weight=1.0)), roi_head=dict( - type='OrientedStandardRoIHead', + type='mmdet.StandardRoIHead', bbox_roi_extractor=dict( type='RotatedSingleRoIExtractor', roi_layer=dict( @@ -52,14 +61,17 @@ out_channels=256, featmap_strides=[4, 8, 16, 32]), bbox_head=dict( - type='RotatedShared2FCBBoxHead', + type='mmdet.Shared2FCBBoxHead', + predict_box_type='rbox', in_channels=256, fc_out_channels=1024, roi_feat_size=7, num_classes=1, + reg_predictor_cfg=dict(type='mmdet.Linear'), + cls_predictor_cfg=dict(type='mmdet.Linear'), bbox_coder=dict( - type='DeltaXYWHAOBBoxCoder', - angle_range=angle_version, + type='DeltaXYWHTRBBoxCoder', + angle_version=angle_version, norm_factor=None, edge_swap=True, proj_xy=True, @@ -67,19 +79,23 @@ target_stds=(0.1, 0.1, 0.2, 0.2, 0.1)), reg_class_agnostic=True, loss_cls=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0), - loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0))), + type='mmdet.CrossEntropyLoss', + use_sigmoid=False, + loss_weight=1.0), + loss_bbox=dict( + type='mmdet.SmoothL1Loss', beta=1.0, loss_weight=1.0))), train_cfg=dict( rpn=dict( assigner=dict( - type='MaxIoUAssigner', + type='mmdet.MaxIoUAssigner', pos_iou_thr=0.7, neg_iou_thr=0.3, min_pos_iou=0.3, match_low_quality=True, - ignore_iof_thr=-1), + ignore_iof_thr=-1, + iou_calculator=dict(type='RBbox2HBboxOverlaps2D')), sampler=dict( - type='RandomSampler', + type='mmdet.RandomSampler', num=256, pos_fraction=0.5, neg_pos_ub=-1, @@ -94,7 +110,7 @@ min_bbox_size=0), rcnn=dict( assigner=dict( - type='MaxIoUAssigner', + type='mmdet.MaxIoUAssigner', pos_iou_thr=0.5, neg_iou_thr=0.5, min_pos_iou=0.5, @@ -102,7 +118,7 @@ iou_calculator=dict(type='RBboxOverlaps2D'), ignore_iof_thr=-1), sampler=dict( - type='RRandomSampler', + type='mmdet.RandomSampler', num=512, pos_fraction=0.25, neg_pos_ub=-1, @@ -119,40 +135,7 @@ nms_pre=2000, min_bbox_size=0, score_thr=0.05, - nms=dict(iou_thr=0.1), + nms=dict(type='nms_rotated', iou_threshold=0.1), max_per_img=2000))) -img_norm_cfg = dict( - mean=[21.55, 21.55, 21.55], std=[24.42, 24.42, 24.42], to_rgb=True) -train_pipeline = [ - dict(type='LoadImageFromFile'), - dict(type='LoadAnnotations', with_bbox=True), - dict(type='RResize', img_scale=(608, 608)), - dict( - type='RRandomFlip', - flip_ratio=[0.25, 0.25, 0.25], - direction=['horizontal', 'vertical', 'diagonal'], - version=angle_version), - dict(type='Normalize', **img_norm_cfg), - dict(type='Pad', size_divisor=32), - dict(type='DefaultFormatBundle'), - dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']) -] -data = dict( - train=dict(pipeline=train_pipeline, version=angle_version), - val=dict(version=angle_version), - test=dict(version=angle_version)) - -optimizer = dict(lr=0.005) - -# evaluation -evaluation = dict(interval=72, metric='mAP') -# learning policy -lr_config = dict( - policy='step', - warmup='linear', - warmup_iters=500, - warmup_ratio=1.0 / 3, - step=[65, 71]) -runner = dict(type='EpochBasedRunner', max_epochs=72) -checkpoint_config = dict(interval=12) +optim_wrapper = dict(optimizer=dict(lr=0.005)) diff --git a/configs/oriented_rcnn/oriented-rcnn-le90_r50_fpn_6x_rsdd.py b/configs/oriented_rcnn/oriented-rcnn-le90_r50_fpn_6x_rsdd.py new file mode 100644 index 000000000..ea54f669e --- /dev/null +++ b/configs/oriented_rcnn/oriented-rcnn-le90_r50_fpn_6x_rsdd.py @@ -0,0 +1,141 @@ +_base_ = [ + '../_base_/datasets/rsdd.py', '../_base_/schedules/schedule_6x.py', + '../_base_/default_runtime.py' +] + +angle_version = 'le90' +model = dict( + type='mmdet.FasterRCNN', + data_preprocessor=dict( + type='mmdet.DetDataPreprocessor', + mean=[123.675, 116.28, 103.53], + std=[58.395, 57.12, 57.375], + bgr_to_rgb=True, + pad_size_divisor=32, + boxtype2tensor=False), + backbone=dict( + type='mmdet.ResNet', + depth=50, + num_stages=4, + out_indices=(0, 1, 2, 3), + frozen_stages=1, + norm_cfg=dict(type='BN', requires_grad=True), + norm_eval=True, + style='pytorch', + init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')), + neck=dict( + type='mmdet.FPN', + in_channels=[256, 512, 1024, 2048], + out_channels=256, + num_outs=5), + rpn_head=dict( + type='OrientedRPNHead', + in_channels=256, + feat_channels=256, + anchor_generator=dict( + type='mmdet.AnchorGenerator', + scales=[8], + ratios=[0.5, 1.0, 2.0], + strides=[4, 8, 16, 32, 64], + use_box_type=True), + bbox_coder=dict( + type='MidpointOffsetCoder', + angle_version=angle_version, + target_means=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + target_stds=[1.0, 1.0, 1.0, 1.0, 0.5, 0.5]), + loss_cls=dict( + type='mmdet.CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0), + loss_bbox=dict( + type='mmdet.SmoothL1Loss', + beta=0.1111111111111111, + loss_weight=1.0)), + roi_head=dict( + type='mmdet.StandardRoIHead', + bbox_roi_extractor=dict( + type='RotatedSingleRoIExtractor', + roi_layer=dict( + type='RoIAlignRotated', + out_size=7, + sample_num=2, + clockwise=True), + out_channels=256, + featmap_strides=[4, 8, 16, 32]), + bbox_head=dict( + type='mmdet.Shared2FCBBoxHead', + predict_box_type='rbox', + in_channels=256, + fc_out_channels=1024, + roi_feat_size=7, + num_classes=1, + reg_predictor_cfg=dict(type='mmdet.Linear'), + cls_predictor_cfg=dict(type='mmdet.Linear'), + bbox_coder=dict( + type='DeltaXYWHTRBBoxCoder', + angle_version=angle_version, + norm_factor=None, + edge_swap=True, + proj_xy=True, + target_means=(.0, .0, .0, .0, .0), + target_stds=(0.1, 0.1, 0.2, 0.2, 0.1)), + reg_class_agnostic=True, + loss_cls=dict( + type='mmdet.CrossEntropyLoss', + use_sigmoid=False, + loss_weight=1.0), + loss_bbox=dict( + type='mmdet.SmoothL1Loss', beta=1.0, loss_weight=1.0))), + train_cfg=dict( + rpn=dict( + assigner=dict( + type='mmdet.MaxIoUAssigner', + pos_iou_thr=0.7, + neg_iou_thr=0.3, + min_pos_iou=0.3, + match_low_quality=True, + ignore_iof_thr=-1, + iou_calculator=dict(type='RBbox2HBboxOverlaps2D')), + sampler=dict( + type='mmdet.RandomSampler', + num=256, + pos_fraction=0.5, + neg_pos_ub=-1, + add_gt_as_proposals=False), + allowed_border=0, + pos_weight=-1, + debug=False), + rpn_proposal=dict( + nms_pre=2000, + max_per_img=2000, + nms=dict(type='nms', iou_threshold=0.8), + min_bbox_size=0), + rcnn=dict( + assigner=dict( + type='mmdet.MaxIoUAssigner', + pos_iou_thr=0.5, + neg_iou_thr=0.5, + min_pos_iou=0.5, + match_low_quality=False, + iou_calculator=dict(type='RBboxOverlaps2D'), + ignore_iof_thr=-1), + sampler=dict( + type='mmdet.RandomSampler', + num=512, + pos_fraction=0.25, + neg_pos_ub=-1, + add_gt_as_proposals=True), + pos_weight=-1, + debug=False)), + test_cfg=dict( + rpn=dict( + nms_pre=2000, + max_per_img=2000, + nms=dict(type='nms', iou_threshold=0.8), + min_bbox_size=0), + rcnn=dict( + nms_pre=2000, + min_bbox_size=0, + score_thr=0.05, + nms=dict(type='nms_rotated', iou_threshold=0.1), + max_per_img=2000))) + +optim_wrapper = dict(optimizer=dict(lr=0.005)) diff --git a/configs/oriented_rcnn/oriented-rcnn-le90_r50_fpn_6x_srsdd.py b/configs/oriented_rcnn/oriented-rcnn-le90_r50_fpn_6x_srsdd.py new file mode 100644 index 000000000..1fbe0cf47 --- /dev/null +++ b/configs/oriented_rcnn/oriented-rcnn-le90_r50_fpn_6x_srsdd.py @@ -0,0 +1,141 @@ +_base_ = [ + '../_base_/datasets/srsdd.py', '../_base_/schedules/schedule_6x.py', + '../_base_/default_runtime.py' +] + +angle_version = 'le90' +model = dict( + type='mmdet.FasterRCNN', + data_preprocessor=dict( + type='mmdet.DetDataPreprocessor', + mean=[123.675, 116.28, 103.53], + std=[58.395, 57.12, 57.375], + bgr_to_rgb=True, + pad_size_divisor=32, + boxtype2tensor=False), + backbone=dict( + type='mmdet.ResNet', + depth=50, + num_stages=4, + out_indices=(0, 1, 2, 3), + frozen_stages=1, + norm_cfg=dict(type='BN', requires_grad=True), + norm_eval=True, + style='pytorch', + init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')), + neck=dict( + type='mmdet.FPN', + in_channels=[256, 512, 1024, 2048], + out_channels=256, + num_outs=5), + rpn_head=dict( + type='OrientedRPNHead', + in_channels=256, + feat_channels=256, + anchor_generator=dict( + type='mmdet.AnchorGenerator', + scales=[8], + ratios=[0.5, 1.0, 2.0], + strides=[4, 8, 16, 32, 64], + use_box_type=True), + bbox_coder=dict( + type='MidpointOffsetCoder', + angle_version=angle_version, + target_means=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + target_stds=[1.0, 1.0, 1.0, 1.0, 0.5, 0.5]), + loss_cls=dict( + type='mmdet.CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0), + loss_bbox=dict( + type='mmdet.SmoothL1Loss', + beta=0.1111111111111111, + loss_weight=1.0)), + roi_head=dict( + type='mmdet.StandardRoIHead', + bbox_roi_extractor=dict( + type='RotatedSingleRoIExtractor', + roi_layer=dict( + type='RoIAlignRotated', + out_size=7, + sample_num=2, + clockwise=True), + out_channels=256, + featmap_strides=[4, 8, 16, 32]), + bbox_head=dict( + type='mmdet.Shared2FCBBoxHead', + predict_box_type='rbox', + in_channels=256, + fc_out_channels=1024, + roi_feat_size=7, + num_classes=6, + reg_predictor_cfg=dict(type='mmdet.Linear'), + cls_predictor_cfg=dict(type='mmdet.Linear'), + bbox_coder=dict( + type='DeltaXYWHTRBBoxCoder', + angle_version=angle_version, + norm_factor=None, + edge_swap=True, + proj_xy=True, + target_means=(.0, .0, .0, .0, .0), + target_stds=(0.1, 0.1, 0.2, 0.2, 0.1)), + reg_class_agnostic=True, + loss_cls=dict( + type='mmdet.CrossEntropyLoss', + use_sigmoid=False, + loss_weight=1.0), + loss_bbox=dict( + type='mmdet.SmoothL1Loss', beta=1.0, loss_weight=1.0))), + train_cfg=dict( + rpn=dict( + assigner=dict( + type='mmdet.MaxIoUAssigner', + pos_iou_thr=0.7, + neg_iou_thr=0.3, + min_pos_iou=0.3, + match_low_quality=True, + ignore_iof_thr=-1, + iou_calculator=dict(type='RBbox2HBboxOverlaps2D')), + sampler=dict( + type='mmdet.RandomSampler', + num=256, + pos_fraction=0.5, + neg_pos_ub=-1, + add_gt_as_proposals=False), + allowed_border=0, + pos_weight=-1, + debug=False), + rpn_proposal=dict( + nms_pre=2000, + max_per_img=2000, + nms=dict(type='nms', iou_threshold=0.8), + min_bbox_size=0), + rcnn=dict( + assigner=dict( + type='mmdet.MaxIoUAssigner', + pos_iou_thr=0.5, + neg_iou_thr=0.5, + min_pos_iou=0.5, + match_low_quality=False, + iou_calculator=dict(type='RBboxOverlaps2D'), + ignore_iof_thr=-1), + sampler=dict( + type='mmdet.RandomSampler', + num=512, + pos_fraction=0.25, + neg_pos_ub=-1, + add_gt_as_proposals=True), + pos_weight=-1, + debug=False)), + test_cfg=dict( + rpn=dict( + nms_pre=2000, + max_per_img=2000, + nms=dict(type='nms', iou_threshold=0.8), + min_bbox_size=0), + rcnn=dict( + nms_pre=2000, + min_bbox_size=0, + score_thr=0.05, + nms=dict(type='nms_rotated', iou_threshold=0.1), + max_per_img=2000))) + +optim_wrapper = dict(optimizer=dict(lr=0.005)) diff --git a/configs/oriented_rcnn/oriented-rcnn-le90_r50_fpn_6x_ssdd.py b/configs/oriented_rcnn/oriented-rcnn-le90_r50_fpn_6x_ssdd.py index f32b4d490..7b7cc2698 100644 --- a/configs/oriented_rcnn/oriented-rcnn-le90_r50_fpn_6x_ssdd.py +++ b/configs/oriented_rcnn/oriented-rcnn-le90_r50_fpn_6x_ssdd.py @@ -1,23 +1,30 @@ _base_ = [ - '../_base_/datasets/ssdd.py', '../_base_/schedules/schedule_3x.py', + '../_base_/datasets/ssdd.py', '../_base_/schedules/schedule_6x.py', '../_base_/default_runtime.py' ] angle_version = 'le90' model = dict( - type='OrientedRCNN', + type='mmdet.FasterRCNN', + data_preprocessor=dict( + type='mmdet.DetDataPreprocessor', + mean=[123.675, 116.28, 103.53], + std=[58.395, 57.12, 57.375], + bgr_to_rgb=True, + pad_size_divisor=32, + boxtype2tensor=False), backbone=dict( - type='ResNet', + type='mmdet.ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), - frozen_stages=-1, + frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), norm_eval=True, style='pytorch', init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')), neck=dict( - type='FPN', + type='mmdet.FPN', in_channels=[256, 512, 1024, 2048], out_channels=256, num_outs=5), @@ -25,23 +32,25 @@ type='OrientedRPNHead', in_channels=256, feat_channels=256, - version=angle_version, anchor_generator=dict( - type='AnchorGenerator', + type='mmdet.AnchorGenerator', scales=[8], ratios=[0.5, 1.0, 2.0], - strides=[4, 8, 16, 32, 64]), + strides=[4, 8, 16, 32, 64], + use_box_type=True), bbox_coder=dict( type='MidpointOffsetCoder', - angle_range=angle_version, + angle_version=angle_version, target_means=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], target_stds=[1.0, 1.0, 1.0, 1.0, 0.5, 0.5]), loss_cls=dict( - type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0), + type='mmdet.CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0), loss_bbox=dict( - type='SmoothL1Loss', beta=0.1111111111111111, loss_weight=1.0)), + type='mmdet.SmoothL1Loss', + beta=0.1111111111111111, + loss_weight=1.0)), roi_head=dict( - type='OrientedStandardRoIHead', + type='mmdet.StandardRoIHead', bbox_roi_extractor=dict( type='RotatedSingleRoIExtractor', roi_layer=dict( @@ -52,14 +61,17 @@ out_channels=256, featmap_strides=[4, 8, 16, 32]), bbox_head=dict( - type='RotatedShared2FCBBoxHead', + type='mmdet.Shared2FCBBoxHead', + predict_box_type='rbox', in_channels=256, fc_out_channels=1024, roi_feat_size=7, num_classes=1, + reg_predictor_cfg=dict(type='mmdet.Linear'), + cls_predictor_cfg=dict(type='mmdet.Linear'), bbox_coder=dict( - type='DeltaXYWHAOBBoxCoder', - angle_range=angle_version, + type='DeltaXYWHTRBBoxCoder', + angle_version=angle_version, norm_factor=None, edge_swap=True, proj_xy=True, @@ -67,19 +79,23 @@ target_stds=(0.1, 0.1, 0.2, 0.2, 0.1)), reg_class_agnostic=True, loss_cls=dict( - type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0), - loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0))), + type='mmdet.CrossEntropyLoss', + use_sigmoid=False, + loss_weight=1.0), + loss_bbox=dict( + type='mmdet.SmoothL1Loss', beta=1.0, loss_weight=1.0))), train_cfg=dict( rpn=dict( assigner=dict( - type='MaxIoUAssigner', + type='mmdet.MaxIoUAssigner', pos_iou_thr=0.7, neg_iou_thr=0.3, min_pos_iou=0.3, match_low_quality=True, - ignore_iof_thr=-1), + ignore_iof_thr=-1, + iou_calculator=dict(type='RBbox2HBboxOverlaps2D')), sampler=dict( - type='RandomSampler', + type='mmdet.RandomSampler', num=256, pos_fraction=0.5, neg_pos_ub=-1, @@ -94,7 +110,7 @@ min_bbox_size=0), rcnn=dict( assigner=dict( - type='MaxIoUAssigner', + type='mmdet.MaxIoUAssigner', pos_iou_thr=0.5, neg_iou_thr=0.5, min_pos_iou=0.5, @@ -102,7 +118,7 @@ iou_calculator=dict(type='RBboxOverlaps2D'), ignore_iof_thr=-1), sampler=dict( - type='RRandomSampler', + type='mmdet.RandomSampler', num=512, pos_fraction=0.25, neg_pos_ub=-1, @@ -119,40 +135,7 @@ nms_pre=2000, min_bbox_size=0, score_thr=0.05, - nms=dict(iou_thr=0.1), + nms=dict(type='nms_rotated', iou_threshold=0.1), max_per_img=2000))) -img_norm_cfg = dict( - mean=[21.55, 21.55, 21.55], std=[24.42, 24.42, 24.42], to_rgb=True) -train_pipeline = [ - dict(type='LoadImageFromFile'), - dict(type='LoadAnnotations', with_bbox=True), - dict(type='RResize', img_scale=(608, 608)), - dict( - type='RRandomFlip', - flip_ratio=[0.25, 0.25, 0.25], - direction=['horizontal', 'vertical', 'diagonal'], - version=angle_version), - dict(type='Normalize', **img_norm_cfg), - dict(type='Pad', size_divisor=32), - dict(type='DefaultFormatBundle'), - dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']) -] -data = dict( - train=dict(pipeline=train_pipeline, version=angle_version), - val=dict(version=angle_version), - test=dict(version=angle_version)) - -optimizer = dict(lr=0.005) - -# evaluation -evaluation = dict(interval=72, metric='mAP') -# learning policy -lr_config = dict( - policy='step', - warmup='linear', - warmup_iters=500, - warmup_ratio=1.0 / 3, - step=[65, 71]) -runner = dict(type='EpochBasedRunner', max_epochs=72) -checkpoint_config = dict(interval=12) +optim_wrapper = dict(optimizer=dict(lr=0.005)) diff --git a/mmrotate/datasets/__init__.py b/mmrotate/datasets/__init__.py index 624d9ec14..dc938e946 100644 --- a/mmrotate/datasets/__init__.py +++ b/mmrotate/datasets/__init__.py @@ -1,7 +1,6 @@ # Copyright (c) OpenMMLab. All rights reserved. from .dota import DOTADataset # noqa: F401, F403 from .hrsc import HRSCDataset # noqa: F401, F403 -from .sar import SARDataset # noqa: F401, F403 from .transforms import * # noqa: F401, F403 -__all__ = ['SARDataset', 'DOTADataset', 'HRSCDataset'] +__all__ = ['DOTADataset', 'HRSCDataset'] diff --git a/mmrotate/datasets/sar.py b/mmrotate/datasets/sar.py deleted file mode 100644 index eaf6ccded..000000000 --- a/mmrotate/datasets/sar.py +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) OpenMMLab. All rights reserved. -from mmrotate.registry import DATASETS -from .dota import DOTADataset - - -@DATASETS.register_module() -class SARDataset(DOTADataset): - """SAR ship dataset for detection (Support RSSDD and HRSID).""" - CLASSES = ('ship', ) - PALETTE = [ - (0, 255, 0), - ] diff --git a/tools/data/hrsid/README.md b/tools/data/hrsid/README.md index 38119957d..20eb3f3f9 100644 --- a/tools/data/hrsid/README.md +++ b/tools/data/hrsid/README.md @@ -26,9 +26,8 @@ mmrotate ├── configs ├── data │ ├── hrsid -│ │ ├── trainsplit -│ │ ├── valsplit -│ │ ├── testsplit +│ │ ├── train +│ │ ├── test ``` ## Change base config From 6222531e04428d2b08f89d7c26574cae2b71a400 Mon Sep 17 00:00:00 2001 From: zytx121 <592267829@qq.com> Date: Tue, 1 Nov 2022 22:22:46 +0800 Subject: [PATCH 3/6] fix lint --- configs/_base_/datasets/rsdd.py | 2 +- configs/_base_/datasets/srsdd.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/configs/_base_/datasets/rsdd.py b/configs/_base_/datasets/rsdd.py index 2764d22c5..064fd3a0d 100644 --- a/configs/_base_/datasets/rsdd.py +++ b/configs/_base_/datasets/rsdd.py @@ -43,7 +43,7 @@ 'scale_factor')) ] -metainfo = dict(CLASSES=('ship',)) +metainfo = dict(CLASSES=('ship', )) train_dataloader = dict( batch_size=2, diff --git a/configs/_base_/datasets/srsdd.py b/configs/_base_/datasets/srsdd.py index 26ae5ec80..ed3433628 100644 --- a/configs/_base_/datasets/srsdd.py +++ b/configs/_base_/datasets/srsdd.py @@ -43,8 +43,9 @@ 'scale_factor')) ] -metainfo = dict(CLASSES=('Container', 'Dredger', 'LawEnforce', 'Cell-Container', - 'ore-oil', 'Fishing')) +metainfo = dict( + CLASSES=('Container', 'Dredger', 'LawEnforce', 'Cell-Container', 'ore-oil', + 'Fishing')) train_dataloader = dict( batch_size=2, From 15f84ce2bc90a0f18ac39c8ce2a5cae008f2c0e4 Mon Sep 17 00:00:00 2001 From: zytx121 <592267829@qq.com> Date: Tue, 1 Nov 2022 22:46:41 +0800 Subject: [PATCH 4/6] Update hrsid --- configs/_base_/datasets/hrsid.py | 10 +++++----- tools/data/hrsid/README.md | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/configs/_base_/datasets/hrsid.py b/configs/_base_/datasets/hrsid.py index 17bc8d9d8..6f4a8b480 100644 --- a/configs/_base_/datasets/hrsid.py +++ b/configs/_base_/datasets/hrsid.py @@ -1,6 +1,6 @@ # dataset settings dataset_type = 'mmdet.CocoDataset' -data_root = 'data/hrsid/' +data_root = 'data/HRSID_JPG/' file_client_args = dict(backend='disk') train_pipeline = [ @@ -55,8 +55,8 @@ type=dataset_type, metainfo=metainfo, data_root=data_root, - ann_file='train/train.json', - data_prefix=dict(img='train/images/'), + ann_file='annotations/train2017.json', + data_prefix=dict(img='JPEGImages/'), filter_cfg=dict(filter_empty_gt=True), pipeline=train_pipeline)) val_dataloader = dict( @@ -69,8 +69,8 @@ type=dataset_type, metainfo=metainfo, data_root=data_root, - ann_file='test/test.json', - data_prefix=dict(img='test/images/'), + ann_file='annotations/test2017.json', + data_prefix=dict(img='JPEGImages/'), test_mode=True, pipeline=val_pipeline)) test_dataloader = val_dataloader diff --git a/tools/data/hrsid/README.md b/tools/data/hrsid/README.md index 20eb3f3f9..ce61539ac 100644 --- a/tools/data/hrsid/README.md +++ b/tools/data/hrsid/README.md @@ -15,7 +15,7 @@ pages={120234-120254}, ## Download HRSID dataset -The HRSID dataset can be downloaded from [here:0518](https://pan.baidu.com/s/1vks9fj64Bb06U170GNL7mw). +The HRSID dataset can be downloaded from [here](https://drive.google.com/file/d/1BZTU8Gyg20wqHXtBPFzRazn_lEdvhsbE/view). The data structure is as follows: @@ -25,11 +25,11 @@ mmrotate ├── tools ├── configs ├── data -│ ├── hrsid -│ │ ├── train -│ │ ├── test +│ ├── HRSID_JPG +│ │ ├── JPEGImages +│ │ ├── annotations ``` ## Change base config -Please change `data_root` in `configs/_base_/datasets/hrisd.py` to `data/hrsid/`. +Please change `data_root` in `configs/_base_/datasets/hrisd.py` to `data/HRSID_JPG/`. From 54ea2283085a71e0faab797158eb77f31b75e490 Mon Sep 17 00:00:00 2001 From: zytx121 <592267829@qq.com> Date: Tue, 1 Nov 2022 23:51:39 +0800 Subject: [PATCH 5/6] update link --- configs/_base_/datasets/ssdd.py | 4 ++-- tools/data/hrsid/README.md | 2 +- tools/data/rsdd/README.md | 2 +- tools/data/srsdd/README.md | 2 +- tools/data/ssdd/README.md | 5 ++++- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/configs/_base_/datasets/ssdd.py b/configs/_base_/datasets/ssdd.py index 6ed2e5821..13d188782 100644 --- a/configs/_base_/datasets/ssdd.py +++ b/configs/_base_/datasets/ssdd.py @@ -69,8 +69,8 @@ type=dataset_type, metainfo=metainfo, data_root=data_root, - ann_file='test/test.json', - data_prefix=dict(img='test/images/'), + ann_file='test/all/test.json', + data_prefix=dict(img='test/all/images/'), test_mode=True, pipeline=val_pipeline)) test_dataloader = val_dataloader diff --git a/tools/data/hrsid/README.md b/tools/data/hrsid/README.md index ce61539ac..c8b9339f1 100644 --- a/tools/data/hrsid/README.md +++ b/tools/data/hrsid/README.md @@ -15,7 +15,7 @@ pages={120234-120254}, ## Download HRSID dataset -The HRSID dataset can be downloaded from [here](https://drive.google.com/file/d/1BZTU8Gyg20wqHXtBPFzRazn_lEdvhsbE/view). +The HRSID dataset can be downloaded from [Google drive](https://drive.google.com/file/d/1BZTU8Gyg20wqHXtBPFzRazn_lEdvhsbE/view). The data structure is as follows: diff --git a/tools/data/rsdd/README.md b/tools/data/rsdd/README.md index f283304e0..fafbe847d 100644 --- a/tools/data/rsdd/README.md +++ b/tools/data/rsdd/README.md @@ -17,7 +17,7 @@ pages={581}, ## Download RSDD dataset -The RSDD dataset can be downloaded from [here:0518](https://pan.baidu.com/s/1_uezALB6eZ7DiPIozFoGJQ). +The RSDD dataset can be downloaded from [Google drive](https://drive.google.com/file/d/1PJxr7Tbr_ZAzuG8MNloDa4mLaRYCD3qc/view?usp=sharing). The data structure is as follows: diff --git a/tools/data/srsdd/README.md b/tools/data/srsdd/README.md index b6de5be8a..53c327c82 100644 --- a/tools/data/srsdd/README.md +++ b/tools/data/srsdd/README.md @@ -18,7 +18,7 @@ pages={5104}, ## Download SRSDD dataset -The SRSDD dataset can be downloaded from [here:0518](https://pan.baidu.com/s/1_uezALB6eZ7DiPIozFoGJQ). +The SRSDD dataset can be downloaded from [Google drive](https://drive.google.com/file/d/1QtCjih1ChOmG-TOPUTlsL3WbMh0L-1zp/view?usp=sharing). The data structure is as follows: diff --git a/tools/data/ssdd/README.md b/tools/data/ssdd/README.md index 4fdb4af34..534ba39e8 100644 --- a/tools/data/ssdd/README.md +++ b/tools/data/ssdd/README.md @@ -17,7 +17,7 @@ pages={3690}, ## Download SSDD dataset -The SSDD dataset can be downloaded from [here:0518](https://pan.baidu.com/s/1_uezALB6eZ7DiPIozFoGJQ). +The SSDD dataset can be downloaded from [Google drive](https://drive.google.com/file/d/1LmoHBk4xUvm0Zdtm8X7256dHigyFW4Nh/view?usp=sharing). The data structure is as follows: @@ -30,6 +30,9 @@ mmrotate │ ├── ssdd │ │ ├── train │ │ ├── test +│ │ │ ├── all +│ │ │ ├── inshore +│ │ │ ├── offshore ``` ## Change base config From 8054111e71c639dbfe8a4d98ebf1c72ba0f35dc1 Mon Sep 17 00:00:00 2001 From: zytx121 <592267829@qq.com> Date: Wed, 2 Nov 2022 21:02:36 +0800 Subject: [PATCH 6/6] update --- configs/_base_/datasets/dota.py | 1 - configs/_base_/datasets/dota_coco.py | 1 - configs/_base_/datasets/dota_ms.py | 1 - configs/_base_/datasets/dota_qbox.py | 1 - configs/_base_/datasets/hrsc.py | 1 - configs/_base_/datasets/hrsid.py | 1 - configs/_base_/datasets/rsdd.py | 1 - configs/_base_/datasets/srsdd.py | 1 - configs/_base_/datasets/ssdd.py | 1 - 9 files changed, 9 deletions(-) diff --git a/configs/_base_/datasets/dota.py b/configs/_base_/datasets/dota.py index 6a045bda6..e0a6c50d9 100644 --- a/configs/_base_/datasets/dota.py +++ b/configs/_base_/datasets/dota.py @@ -28,7 +28,6 @@ test_pipeline = [ dict(type='mmdet.LoadImageFromFile', file_client_args=file_client_args), dict(type='mmdet.Resize', scale=(1024, 1024), keep_ratio=True), - # avoid bboxes being resized dict( type='mmdet.PackDetInputs', meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', diff --git a/configs/_base_/datasets/dota_coco.py b/configs/_base_/datasets/dota_coco.py index 4d9618fe0..f7c66bbc9 100644 --- a/configs/_base_/datasets/dota_coco.py +++ b/configs/_base_/datasets/dota_coco.py @@ -36,7 +36,6 @@ test_pipeline = [ dict(type='mmdet.LoadImageFromFile', file_client_args=file_client_args), dict(type='mmdet.Resize', scale=(1024, 1024), keep_ratio=True), - # avoid bboxes being resized dict( type='mmdet.PackDetInputs', meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', diff --git a/configs/_base_/datasets/dota_ms.py b/configs/_base_/datasets/dota_ms.py index a4d4746be..be85328d8 100644 --- a/configs/_base_/datasets/dota_ms.py +++ b/configs/_base_/datasets/dota_ms.py @@ -33,7 +33,6 @@ test_pipeline = [ dict(type='mmdet.LoadImageFromFile', file_client_args=file_client_args), dict(type='mmdet.Resize', scale=(1024, 1024), keep_ratio=True), - # avoid bboxes being resized dict( type='mmdet.PackDetInputs', meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', diff --git a/configs/_base_/datasets/dota_qbox.py b/configs/_base_/datasets/dota_qbox.py index 8cbbd93e4..3bc387bc9 100644 --- a/configs/_base_/datasets/dota_qbox.py +++ b/configs/_base_/datasets/dota_qbox.py @@ -26,7 +26,6 @@ test_pipeline = [ dict(type='mmdet.LoadImageFromFile', file_client_args=file_client_args), dict(type='mmdet.Resize', scale=(1024, 1024), keep_ratio=True), - # avoid bboxes being resized dict( type='mmdet.PackDetInputs', meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', diff --git a/configs/_base_/datasets/hrsc.py b/configs/_base_/datasets/hrsc.py index 6b088e4d3..a31c34fd2 100644 --- a/configs/_base_/datasets/hrsc.py +++ b/configs/_base_/datasets/hrsc.py @@ -28,7 +28,6 @@ test_pipeline = [ dict(type='mmdet.LoadImageFromFile', file_client_args=file_client_args), dict(type='mmdet.Resize', scale=(800, 512), keep_ratio=True), - # avoid bboxes being resized dict( type='mmdet.PackDetInputs', meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', diff --git a/configs/_base_/datasets/hrsid.py b/configs/_base_/datasets/hrsid.py index 6f4a8b480..61c739dcd 100644 --- a/configs/_base_/datasets/hrsid.py +++ b/configs/_base_/datasets/hrsid.py @@ -36,7 +36,6 @@ test_pipeline = [ dict(type='mmdet.LoadImageFromFile', file_client_args=file_client_args), dict(type='mmdet.Resize', scale=(800, 800), keep_ratio=True), - # avoid bboxes being resized dict( type='mmdet.PackDetInputs', meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', diff --git a/configs/_base_/datasets/rsdd.py b/configs/_base_/datasets/rsdd.py index 064fd3a0d..a79c48079 100644 --- a/configs/_base_/datasets/rsdd.py +++ b/configs/_base_/datasets/rsdd.py @@ -36,7 +36,6 @@ test_pipeline = [ dict(type='mmdet.LoadImageFromFile', file_client_args=file_client_args), dict(type='mmdet.Resize', scale=(512, 512), keep_ratio=True), - # avoid bboxes being resized dict( type='mmdet.PackDetInputs', meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', diff --git a/configs/_base_/datasets/srsdd.py b/configs/_base_/datasets/srsdd.py index ed3433628..df0f03026 100644 --- a/configs/_base_/datasets/srsdd.py +++ b/configs/_base_/datasets/srsdd.py @@ -36,7 +36,6 @@ test_pipeline = [ dict(type='mmdet.LoadImageFromFile', file_client_args=file_client_args), dict(type='mmdet.Resize', scale=(1024, 1024), keep_ratio=True), - # avoid bboxes being resized dict( type='mmdet.PackDetInputs', meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', diff --git a/configs/_base_/datasets/ssdd.py b/configs/_base_/datasets/ssdd.py index 13d188782..cc618b5a2 100644 --- a/configs/_base_/datasets/ssdd.py +++ b/configs/_base_/datasets/ssdd.py @@ -36,7 +36,6 @@ test_pipeline = [ dict(type='mmdet.LoadImageFromFile', file_client_args=file_client_args), dict(type='mmdet.Resize', scale=(512, 512), keep_ratio=True), - # avoid bboxes being resized dict( type='mmdet.PackDetInputs', meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',