mmsegmentation/mmseg/datasets/isprs.py

26 lines
854 B
Python
Raw Normal View History

# Copyright (c) OpenMMLab. All rights reserved.
2022-05-10 20:15:20 +08:00
from mmseg.registry import DATASETS
from .custom import BaseSegDataset
@DATASETS.register_module()
class ISPRSDataset(BaseSegDataset):
"""ISPRS dataset.
2022-07-05 20:43:33 +08:00
In segmentation map annotation for ISPRS, 0 is the ignore index.
``reduce_zero_label`` should be set to True. The ``img_suffix`` and
``seg_map_suffix`` are both fixed to '.png'.
"""
2022-05-26 17:13:40 +08:00
METAINFO = dict(
classes=('impervious_surface', 'building', 'low_vegetation', 'tree',
'car', 'clutter'),
palette=[[255, 255, 255], [0, 0, 255], [0, 255, 255], [0, 255, 0],
[255, 255, 0], [255, 0, 0]])
2022-05-26 17:13:40 +08:00
def __init__(self, **kwargs) -> None:
super().__init__(
img_suffix='.png',
seg_map_suffix='.png',
reduce_zero_label=True,
**kwargs)