Encode images with backbone and decode into a semantic segmentation map of the same size as input.
(self, img, img_metas)
| 82 | return x |
| 83 | |
| 84 | def encode_decode(self, img, img_metas): |
| 85 | """Encode images with backbone and decode into a semantic segmentation |
| 86 | map of the same size as input.""" |
| 87 | x = self.extract_feat(img) |
| 88 | out = self._decode_head_forward_test(x, img_metas) |
| 89 | out = resize( |
| 90 | input=out, |
| 91 | size=img.shape[2:], |
| 92 | mode='bilinear', |
| 93 | align_corners=self.align_corners) |
| 94 | return out |
| 95 | |
| 96 | def _decode_head_forward_train(self, x, img_metas, gt_semantic_seg): |
| 97 | """Run forward function and calculate loss for decode head in |
no test coverage detected