class_docstr: Cascade Encoder Decoder segmentors.
  
  CascadeEncoderDecoder almost the same as EncoderDecoder, while decoders of
  CascadeEncoderDecoder are cascaded. The output of previous decoder_head
  will be the input of next decoder_head.
class_docstr_tok: ["Cascade","Encoder","Decoder","segmentors",".","CascadeEncoderDecoder","almost","the","same","as","EncoderDecoder",",","while","decoders","of","CascadeEncoderDecoder","are","cascaded",".","The","output","of","previous","decoder_head","will","be","the","input","of","next","decoder_head","."]
docstr: Encode images with backbone and decode into a semantic segmentation
  map of the same size as input.
docstr_tok: ["Encode","images","with","backbone","and","decode","into","a","semantic","segmentation","map","of","the","same","size","as","input","."]
code: def encode_decode(self, img, img_metas):
      """Encode images with backbone and decode into a semantic segmentation
      map of the same size as input."""
      x = self.extract_feat(img)
      out = self.decode_head[0].forward_test(
          x, img_metas, self.test_cfg
      )
      for i in range(1, self.num_stages):
          out = self.decode_head[i].forward_test(
              x, out, img_metas, self.test_cfg
          )
      out = resize(
          input=out,
          size=img.shape[2:],
          mode="bilinear",
          align_corners=self.align_corners,
      )
      return out
  
file_path: lavis/lavis/common/annotator/uniformer/mmseg/models/segmentors/cascade_encoder_decoder.py
imports: from torch import nn
  from annotator.uniformer.mmseg.core import add_prefix
  from annotator.uniformer.mmseg.ops import resize
  from ..None import builder
  from ..builder import SEGMENTORS
  from .encoder_decoder import EncoderDecoder
label_desc: Use image node_id 4 for calling the CascadeEncoderDecoder obj's underlying member method code with example usage: obj.encode_decode(img, img_metas) and returns: out