2022-02-23 23:44:27 +08:00
|
|
|
# Copyright (c) OpenMMLab. All rights reserved.
|
2023-02-01 17:53:22 +08:00
|
|
|
import mmengine.fileio as fileio
|
|
|
|
|
2022-05-10 20:15:20 +08:00
|
|
|
from mmseg.registry import DATASETS
|
2022-08-05 20:37:35 +08:00
|
|
|
from .basesegdataset import BaseSegDataset
|
2022-02-17 19:07:32 +08:00
|
|
|
|
|
|
|
|
|
|
|
@DATASETS.register_module()
|
2022-07-26 12:01:40 +08:00
|
|
|
class iSAIDDataset(BaseSegDataset):
|
2022-02-17 19:07:32 +08:00
|
|
|
""" iSAID: A Large-scale Dataset for Instance Segmentation in Aerial Images
|
|
|
|
In segmentation map annotation for iSAID dataset, which is included
|
|
|
|
in 16 categories. ``reduce_zero_label`` is fixed to False. The
|
|
|
|
``img_suffix`` is fixed to '.png' and ``seg_map_suffix`` is fixed to
|
|
|
|
'_manual1.png'.
|
|
|
|
"""
|
|
|
|
|
2022-05-26 17:13:40 +08:00
|
|
|
METAINFO = dict(
|
|
|
|
classes=('background', 'ship', 'store_tank', 'baseball_diamond',
|
|
|
|
'tennis_court', 'basketball_court', 'Ground_Track_Field',
|
|
|
|
'Bridge', 'Large_Vehicle', 'Small_Vehicle', 'Helicopter',
|
|
|
|
'Swimming_pool', 'Roundabout', 'Soccer_ball_field', 'plane',
|
|
|
|
'Harbor'),
|
|
|
|
palette=[[0, 0, 0], [0, 0, 63], [0, 63, 63], [0, 63, 0], [0, 63, 127],
|
|
|
|
[0, 63, 191], [0, 63, 255], [0, 127, 63], [0, 127, 127],
|
|
|
|
[0, 0, 127], [0, 0, 191], [0, 0, 255], [0, 191, 127],
|
|
|
|
[0, 127, 191], [0, 127, 255], [0, 100, 155]])
|
|
|
|
|
2022-12-05 22:27:04 +08:00
|
|
|
def __init__(self,
|
|
|
|
img_suffix='.png',
|
|
|
|
seg_map_suffix='_instance_color_RGB.png',
|
|
|
|
ignore_index=255,
|
|
|
|
**kwargs) -> None:
|
2022-05-26 17:13:40 +08:00
|
|
|
super().__init__(
|
2022-12-05 22:27:04 +08:00
|
|
|
img_suffix=img_suffix,
|
|
|
|
seg_map_suffix=seg_map_suffix,
|
|
|
|
ignore_index=ignore_index,
|
2022-02-17 19:07:32 +08:00
|
|
|
**kwargs)
|
2023-02-01 17:53:22 +08:00
|
|
|
assert fileio.exists(
|
|
|
|
self.data_prefix['img_path'], backend_args=self.backend_args)
|