This model was contributed by nielsr. The original code can be found here.
Tips:
SegFormer consists of a hierarchical Transformer encoder, and a lightweight all-MLP decode head.
  [SegformerModel] is the hierarchical Transformer encoder (which in the paper is also referred to
  as Mix Transformer or MiT). [SegformerForSemanticSegmentation] adds the all-MLP decode head on
  top to perform semantic segmentation of images. In addition, there's
  [SegformerForImageClassification] which can be used to - you guessed it - classify images. The
  authors of SegFormer first pre-trained the Transformer encoder on ImageNet-1k to classify images. Next, they throw
  away the classification head, and replace it by the all-MLP decode head. Next, they fine-tune the model altogether on
  ADE20K, Cityscapes and COCO-stuff, which are important benchmarks for semantic segmentation. All checkpoints can be
