mmsegmentation/mmseg/datasets/isprs.py

26 lines
852 B
Python

# Copyright (c) OpenMMLab. All rights reserved.
from mmseg.registry import DATASETS
from .custom import CustomDataset
@DATASETS.register_module()
class ISPRSDataset(CustomDataset):
"""ISPRS dataset.
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'.
"""
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]])
def __init__(self, **kwargs) -> None:
super().__init__(
img_suffix='.png',
seg_map_suffix='.png',
reduce_zero_label=True,
**kwargs)