Skip to content

Commit

Permalink
add support for 4D output (open-mmlab#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
drcut authored Sep 23, 2020
1 parent 7baed65 commit 588a2c0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mmseg/models/segmentors/encoder_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ def simple_test(self, img, img_meta, rescale=True):
seg_logit = self.inference(img, img_meta, rescale)
seg_pred = seg_logit.argmax(dim=1)
if torch.onnx.is_in_onnx_export():
# our inference backend only support 4D output
seg_pred = seg_pred.unsqueeze(0)
return seg_pred
seg_pred = seg_pred.cpu().numpy()
# unravel batch dim
Expand Down

0 comments on commit 588a2c0

Please sign in to comment.