From 4686f1ec28093a8511fe6b32a36aa34b08e67f79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=98=95=E8=BE=B0?= Date: Fri, 27 Aug 2021 14:53:36 +0800 Subject: [PATCH] [Enhancement] Support inherit cityscapes dataset (#750) * rewrite init function * init function parameters --- mmseg/datasets/cityscapes.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mmseg/datasets/cityscapes.py b/mmseg/datasets/cityscapes.py index 5802622e7..2be00d684 100644 --- a/mmseg/datasets/cityscapes.py +++ b/mmseg/datasets/cityscapes.py @@ -29,11 +29,12 @@ class CityscapesDataset(CustomDataset): [255, 0, 0], [0, 0, 142], [0, 0, 70], [0, 60, 100], [0, 80, 100], [0, 0, 230], [119, 11, 32]] - def __init__(self, **kwargs): + def __init__(self, + img_suffix='_leftImg8bit.png', + seg_map_suffix='_gtFine_labelTrainIds.png', + **kwargs): super(CityscapesDataset, self).__init__( - img_suffix='_leftImg8bit.png', - seg_map_suffix='_gtFine_labelTrainIds.png', - **kwargs) + img_suffix=img_suffix, seg_map_suffix=seg_map_suffix, **kwargs) @staticmethod def _convert_to_label_id(result):