Encode images with backbone and decode into a semantic segmentation map of the same size as input.
(self, img, img_metas)
| 70 | return x |
| 71 | |
| 72 | def encode_decode(self, img, img_metas): |
| 73 | """Encode images with backbone and decode into a semantic segmentation |
| 74 | map of the same size as input.""" |
| 75 | x = self.extract_feat(img) |
| 76 | out = self._decode_head_forward_test(x, img_metas) |
| 77 | out = resize(input=out, size=img.shape[2:], mode="bilinear", align_corners=self.align_corners) |
| 78 | return out |
| 79 | |
| 80 | def _decode_head_forward_train(self, x, img_metas, gt_semantic_seg): |
| 81 | """Run forward function and calculate loss for decode head in |
no test coverage detected