MCPcopy Create free account
hub / github.com/VCIP-RGBD/DFormer / encode_decode

Method encode_decode

mmseg/models/segmentors/encoder_decoder.py:72–78  ·  view source on GitHub ↗

Encode images with backbone and decode into a semantic segmentation map of the same size as input.

(self, img, img_metas)

Source from the content-addressed store, hash-verified

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

Callers 3

forward_dummyMethod · 0.95
slide_inferenceMethod · 0.95
whole_inferenceMethod · 0.95

Calls 3

extract_featMethod · 0.95
resizeFunction · 0.90

Tested by

no test coverage detected