Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions configs/_base_/datasets/dota.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
data_root=data_root,
ann_file='trainval/annfiles/',
data_prefix=dict(img_path='trainval/images/'),
img_shape=(1024, 1024),
filter_cfg=dict(filter_empty_gt=True),
pipeline=train_pipeline))
val_dataloader = dict(
Expand All @@ -58,7 +57,6 @@
data_root=data_root,
ann_file='trainval/annfiles/',
data_prefix=dict(img_path='trainval/images/'),
img_shape=(1024, 1024),
test_mode=True,
pipeline=val_pipeline))
test_dataloader = val_dataloader
Expand All @@ -78,7 +76,6 @@
# type=dataset_type,
# data_root=data_root,
# data_prefix=dict(img_path='test/images/'),
# img_shape=(1024, 1024),
# test_mode=True,
# pipeline=test_pipeline))
# test_evaluator = dict(
Expand Down
3 changes: 0 additions & 3 deletions configs/_base_/datasets/dota_ms.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
data_root=data_root,
ann_file='trainval/annfiles/',
data_prefix=dict(img_path='trainval/images/'),
img_shape=(1024, 1024),
filter_cfg=dict(filter_empty_gt=True),
pipeline=train_pipeline))
val_dataloader = dict(
Expand All @@ -63,7 +62,6 @@
data_root=data_root,
ann_file='trainval/annfiles/',
data_prefix=dict(img_path='trainval/images/'),
img_shape=(1024, 1024),
test_mode=True,
pipeline=val_pipeline))
test_dataloader = val_dataloader
Expand All @@ -83,7 +81,6 @@
# type=dataset_type,
# data_root=data_root,
# data_prefix=dict(img_path='test/images/'),
# img_shape=(1024, 1024),
# test_mode=True,
# pipeline=test_pipeline))
# test_evaluator = dict(
Expand Down
3 changes: 0 additions & 3 deletions configs/_base_/datasets/dota_qbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
data_root=data_root,
ann_file='trainval/annfiles/',
data_prefix=dict(img_path='trainval/images/'),
img_shape=(1024, 1024),
filter_cfg=dict(filter_empty_gt=True),
pipeline=train_pipeline))
val_dataloader = dict(
Expand All @@ -56,7 +55,6 @@
data_root=data_root,
ann_file='trainval/annfiles/',
data_prefix=dict(img_path='trainval/images/'),
img_shape=(1024, 1024),
test_mode=True,
pipeline=val_pipeline))
test_dataloader = val_dataloader
Expand All @@ -77,7 +75,6 @@
# type=dataset_type,
# data_root=data_root,
# data_prefix=dict(img_path='test/images/'),
# img_shape=(1024, 1024),
# test_mode=True,
# pipeline=test_pipeline))
# test_evaluator = dict(
Expand Down
3 changes: 0 additions & 3 deletions configs/_base_/datasets/dotav15.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
data_root=data_root,
ann_file='trainval/annfiles/',
data_prefix=dict(img_path='trainval/images/'),
img_shape=(1024, 1024),
filter_cfg=dict(filter_empty_gt=True),
pipeline=train_pipeline))
val_dataloader = dict(
Expand All @@ -58,7 +57,6 @@
data_root=data_root,
ann_file='trainval/annfiles/',
data_prefix=dict(img_path='trainval/images/'),
img_shape=(1024, 1024),
test_mode=True,
pipeline=val_pipeline))
test_dataloader = val_dataloader
Expand All @@ -78,7 +76,6 @@
# type=dataset_type,
# data_root=data_root,
# data_prefix=dict(img_path='test/images/'),
# img_shape=(1024, 1024),
# test_mode=True,
# pipeline=test_pipeline))
# test_evaluator = dict(
Expand Down
3 changes: 0 additions & 3 deletions configs/_base_/datasets/dotav2.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
data_root=data_root,
ann_file='trainval/annfiles/',
data_prefix=dict(img_path='trainval/images/'),
img_shape=(1024, 1024),
filter_cfg=dict(filter_empty_gt=True),
pipeline=train_pipeline))
val_dataloader = dict(
Expand All @@ -58,7 +57,6 @@
data_root=data_root,
ann_file='trainval/annfiles/',
data_prefix=dict(img_path='trainval/images/'),
img_shape=(1024, 1024),
test_mode=True,
pipeline=val_pipeline))
test_dataloader = val_dataloader
Expand All @@ -78,7 +76,6 @@
# type=dataset_type,
# data_root=data_root,
# data_prefix=dict(img_path='test/images/'),
# img_shape=(1024, 1024),
# test_mode=True,
# pipeline=test_pipeline))
# test_evaluator = dict(
Expand Down
3 changes: 0 additions & 3 deletions configs/rotated_rtmdet/_base_/dota_rr.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
data_root=data_root,
ann_file='trainval/annfiles/',
data_prefix=dict(img_path='trainval/images/'),
img_shape=(1024, 1024),
filter_cfg=dict(filter_empty_gt=True),
pipeline=train_pipeline))
val_dataloader = dict(
Expand All @@ -74,7 +73,6 @@
data_root=data_root,
ann_file='trainval/annfiles/',
data_prefix=dict(img_path='trainval/images/'),
img_shape=(1024, 1024),
test_mode=True,
pipeline=val_pipeline))
test_dataloader = val_dataloader
Expand All @@ -94,7 +92,6 @@
# type=dataset_type,
# data_root=data_root,
# data_prefix=dict(img_path='test/images/'),
# img_shape=(1024, 1024),
# test_mode=True,
# pipeline=test_pipeline))
# test_evaluator = dict(
Expand Down
3 changes: 0 additions & 3 deletions configs/rotated_rtmdet/_base_/dota_rr_ms.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
data_root=data_root,
ann_file='trainval/annfiles/',
data_prefix=dict(img_path='trainval/images/'),
img_shape=(1024, 1024),
filter_cfg=dict(filter_empty_gt=True),
pipeline=train_pipeline))
val_dataloader = dict(
Expand All @@ -73,7 +72,6 @@
data_root=data_root,
ann_file='trainval/annfiles/',
data_prefix=dict(img_path='trainval/images/'),
img_shape=(1024, 1024),
test_mode=True,
pipeline=val_pipeline))
test_dataloader = val_dataloader
Expand All @@ -93,7 +91,6 @@
# type=dataset_type,
# data_root=data_root,
# data_prefix=dict(img_path='test/images/'),
# img_shape=(1024, 1024),
# test_mode=True,
# pipeline=test_pipeline))
# test_evaluator = dict(
Expand Down
18 changes: 6 additions & 12 deletions mmrotate/datasets/dota.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) OpenMMLab. All rights reserved.
import glob
import os.path as osp
from typing import List, Tuple
from typing import List

from mmengine.dataset import BaseDataset

Expand All @@ -17,12 +17,10 @@ class DOTADataset(BaseDataset):
it is the path of a folder containing XML files.

Args:
img_shape (tuple[int]): The shape of images. Due to the huge size
of the remote sensing image, we will cut it into slices with
the same shape. Defaults to (1024, 1024).
diff_thr (int): The difficulty threshold of ground truth. Bboxes
with difficulty higher than it will be ignored. The range of this
value should be non-negative integer. Defaults to 100.
img_suffix (str): The suffix of images. Defaults to 'png'.
"""

METAINFO = {
Expand All @@ -40,11 +38,11 @@ class DOTADataset(BaseDataset):
}

def __init__(self,
img_shape: Tuple[int, int] = (1024, 1024),
diff_thr: int = 100,
img_suffix: str = 'png',
**kwargs) -> None:
self.img_shape = img_shape
self.diff_thr = diff_thr
self.img_suffix = img_suffix
super().__init__(**kwargs)

def load_data_list(self) -> List[dict]:
Expand All @@ -58,16 +56,14 @@ def load_data_list(self) -> List[dict]:
data_list = []
if self.ann_file == '':
img_files = glob.glob(
osp.join(self.data_prefix['img_path'], '*.png'))
osp.join(self.data_prefix['img_path'], f'*.{self.img_suffix}'))
for img_path in img_files:
data_info = {}
data_info['img_path'] = img_path
img_name = osp.split(img_path)[1]
data_info['file_name'] = img_name
img_id = img_name[:-4]
data_info['img_id'] = img_id
data_info['height'] = self.img_shape[0]
data_info['width'] = self.img_shape[1]

instance = dict(bbox=[], bbox_label=[], ignore_flag=0)
data_info['instances'] = [instance]
Expand All @@ -83,12 +79,10 @@ def load_data_list(self) -> List[dict]:
data_info = {}
img_id = osp.split(txt_file)[1][:-4]
data_info['img_id'] = img_id
img_name = img_id + '.png'
img_name = img_id + f'.{self.img_suffix}'
data_info['file_name'] = img_name
data_info['img_path'] = osp.join(self.data_prefix['img_path'],
img_name)
data_info['height'] = self.img_shape[0]
data_info['width'] = self.img_shape[1]

instances = []
with open(txt_file) as f:
Expand Down