Skip to content

Commit

Permalink
Revert "[Enhancement] Change assertion logic inference cfg.model.test…
Browse files Browse the repository at this point in the history
…_cfg (#3012)"

This reverts commit b0635ff.
  • Loading branch information
xiexinch committed Jun 19, 2023
1 parent b0635ff commit 579a21a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 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
``SegDataSample`` including ``pred_sem_seg`` and ``seg_logits``.
``SegDataSampel`` including ``pred_sem_seg`` and ``seg_logits``.
.. code:: text
Expand Down Expand Up @@ -326,9 +326,8 @@ 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.get('mode', 'whole') in ['slide', 'whole'], \
f'Only "slide" or "whole" test mode are supported, but got ' \
f'{self.test_cfg.mode}'

assert self.test_cfg.mode in ['slide', 'whole']
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

0 comments on commit 579a21a

Please sign in to comment.