From dbb1316c471a2fb06e1f8bbd902364e3a7b025ea Mon Sep 17 00:00:00 2001 From: MengzhangLI Date: Tue, 7 Jun 2022 18:59:58 +0800 Subject: [PATCH] [Fix] Fix wrong example in SegDataSample --- mmseg/core/data_structures/seg_data_sample.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mmseg/core/data_structures/seg_data_sample.py b/mmseg/core/data_structures/seg_data_sample.py index 23b60d5b6..ad7677e9d 100644 --- a/mmseg/core/data_structures/seg_data_sample.py +++ b/mmseg/core/data_structures/seg_data_sample.py @@ -22,10 +22,10 @@ class SegDataSample(BaseDataElement): >>> img_meta = dict(img_shape=(4, 4, 3), ... pad_shape=(4, 4, 3)) >>> gt_segmentations = PixelData(metainfo=img_meta) - >>> gt_segmentations.gt_sem_seg = torch.randint(0, 2, (1, 4, 4)) - >>> data_sample.gt_segmentations = gt_segmentations - >>> assert 'img_shape' in data_sample.gt_segmentations.metainfo_keys() - >>> data_sample.gt_segmentations + >>> gt_segmentations.data = torch.randint(0, 2, (1, 4, 4)) + >>> data_sample.gt_sem_seg = gt_segmentations + >>> assert 'img_shape' in data_sample.gt_sem_seg.metainfo_keys() + >>> data_sample.gt_sem_seg.shape (4, 4) >>> print(data_sample)