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-08-05 20:37:35 +08:00
|
|
|
from .basesegdataset 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-12-05 22:27:04 +08:00
|
|
|
def __init__(self,
|
|
|
|
img_suffix='.png',
|
|
|
|
seg_map_suffix='_manual1.png',
|
|
|
|
reduce_zero_label=False,
|
|
|
|
**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,
|
|
|
|
reduce_zero_label=reduce_zero_label,
|
2020-10-23 08:27:40 +08:00
|
|
|
**kwargs)
|
2022-05-26 17:13:40 +08:00
|
|
|
assert self.file_client.exists(self.data_prefix['img_path'])
|