class_docstr: The SegFormer implementation based on PaddlePaddle.
  
  The original article refers to
  Xie, Enze, et al. "SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers." arXiv preprint arXiv:2105.15203 (2021).
  
  Args:
      num_classes (int): The unique number of target classes.
      backbone (Paddle.nn.Layer): A backbone network.
      embedding_dim (int): The MLP decoder channel dimension.
      align_corners (bool): An argument of F.interpolate. It should be set to False when the output size of feature.
          is even, e.g. 1024x512, otherwise it is True, e.g. 769x769. Default: False.
      pretrained (str, optional): The path or url of pretrained model. Default: None.
code: def __init__(
      self,
      num_classes,
      backbone,
      embedding_dim,
      align_corners=False,
      pretrained=None,
  ):
      super(SegFormer, self).__init__()
  
      self.pretrained = pretrained
      self.align_corners = align_corners
      self.backbone = backbone
      self.num_classes = num_classes
      (
          c1_in_channels,
          c2_in_channels,
          c3_in_channels,
          c4_in_channels,
      ) = self.backbone.feat_channels
  
      self.linear_c4 = MLP(
          input_dim=c4_in_channels, embed_dim=embedding_dim
      )
      self.linear_c3 = MLP(
          input_dim=c3_in_channels, embed_dim=embedding_dim
      )
      self.linear_c2 = MLP(
          input_dim=c2_in_channels, embed_dim=embedding_dim
      )
      self.linear_c1 = MLP(
          input_dim=c1_in_channels, embed_dim=embedding_dim
      )
  
      self.dropout = nn.Dropout2D(0.1)
      self.linear_fuse = layers.ConvBNReLU(
          in_channels=embedding_dim * 4,
          out_channels=embedding_dim,
          kernel_size=1,
          bias_attr=False,
      )
  
      self.linear_pred = nn.Conv2D(
          embedding_dim, self.num_classes, kernel_size=1
      )
  
      self.init_weight()
  
file_path: PaddleSeg/paddleseg/models/segformer.py
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  import numpy
  from paddleseg.cvlibs import manager
  from paddleseg.models import layers
  from paddleseg.utils import utils
label_desc: Use image node_id 1 to create a new SegFormer object from inherited base classes: nn with example: obj = SegFormer(num_classes, backbone, embedding_dim, align_corners, pretrained)