Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions mmseg/models/segmentors/encoder_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class EncoderDecoder(BaseSegmentor):
2. The ``predict`` method is used to predict segmentation results,
which includes two steps: (1) Run inference function to obtain the list of
seg_logits (2) Call post-processing function to obtain list of
``SegDataSampel`` including ``pred_sem_seg`` and ``seg_logits``.
``SegDataSample`` including ``pred_sem_seg`` and ``seg_logits``.

.. code:: text

Expand Down Expand Up @@ -326,8 +326,9 @@ def inference(self, inputs: Tensor, batch_img_metas: List[dict]) -> Tensor:
Tensor: The segmentation results, seg_logits from model of each
input image.
"""

assert self.test_cfg.mode in ['slide', 'whole']
assert self.test_cfg.get('mode', 'whole') in ['slide', 'whole'], \
f'Only "slide" or "whole" test mode are supported, but got ' \
f'{self.test_cfg.mode}'
ori_shape = batch_img_metas[0]['ori_shape']
assert all(_['ori_shape'] == ori_shape for _ in batch_img_metas)
if self.test_cfg.mode == 'slide':
Expand Down