MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / encode_decode

Method encode_decode

modeling/pi3/models/segformer/model.py:59–69  ·  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

57 return seg_logits
58
59 def encode_decode(self, img, img_metas):
60 """Encode images with backbone and decode into a semantic segmentation
61 map of the same size as input."""
62 x = self.extract_feat(img)
63 out = self._decode_head_forward_test(x, img_metas)
64 out = resize(
65 input=out,
66 size=img.shape[2:],
67 mode='bilinear',
68 align_corners=self.align_corners)
69 return out
70
71 def whole_inference(self, img, img_meta, rescale):
72 """Inference with full image."""

Callers 2

whole_inferenceMethod · 0.95
inference_Method · 0.95

Calls 3

extract_featMethod · 0.95
resizeFunction · 0.85

Tested by

no test coverage detected