2021-08-17 14:16:55 +08:00
|
|
|
# Copyright (c) OpenMMLab. All rights reserved.
|
2020-10-23 08:27:40 +08:00
|
|
|
|
2022-05-10 20:15:20 +08:00
|
|
|
from mmseg.registry import DATASETS
|
2022-07-26 12:01:40 +08:00
|
|
|
from .custom import BaseSegDataset
|
2020-10-23 08:27:40 +08:00
|
|
|
|
|
|
|
|
|
|
|
@DATASETS.register_module()
|
2022-07-26 12:01:40 +08:00
|
|
|
class DRIVEDataset(BaseSegDataset):
|
2020-10-23 08:27:40 +08:00
|
|
|
"""DRIVE dataset.
|
|
|
|
|
|
|
|
In segmentation map annotation for DRIVE, 0 stands for background, which is
|
|
|
|
included in 2 categories. ``reduce_zero_label`` is fixed to False. The
|
2020-10-29 02:58:44 +08:00
|
|
|
``img_suffix`` is fixed to '.png' and ``seg_map_suffix`` is fixed to
|
|
|
|
'_manual1.png'.
|
2020-10-23 08:27:40 +08:00
|
|
|
"""
|
2022-05-26 17:13:40 +08:00
|
|
|
METAINFO = dict(
|
|
|
|
classes=('background', 'vessel'),
|
|
|
|
palette=[[120, 120, 120], [6, 230, 230]])
|
2020-10-23 08:27:40 +08:00
|
|
|
|
2022-05-26 17:13:40 +08:00
|
|
|
def __init__(self, **kwargs) -> None:
|
|
|
|
super().__init__(
|
2020-10-29 02:58:44 +08:00
|
|
|
img_suffix='.png',
|
|
|
|
seg_map_suffix='_manual1.png',
|
2020-10-23 08:27:40 +08:00
|
|
|
reduce_zero_label=False,
|
|
|
|
**kwargs)
|
2022-05-26 17:13:40 +08:00
|
|
|
assert self.file_client.exists(self.data_prefix['img_path'])
|