class_docstr: The SETR implementation based on PaddlePaddle.
  
  The original article refers to
      Zheng, Sixiao, et al. "Rethinking Semantic Segmentation from a Sequence-to-Sequence Perspective with Transformers"
      (https://arxiv.org/abs/2012.15840)
  
  Args:
      num_classes (int): The unique number of target classes.
      backbone (Paddle.nn.Layer): Backbone network.
      backbone_indices (tuple): A tuple indicates the indices of output of backbone.
          It can be either one or two values, if two values, the first index will be taken as
          a deep-supervision feature in auxiliary layer; the second one will be taken as
          input of pixel representation. If one value, it is taken by both above.
      head (str, optional): SETR head type(naive, pup or mla). Default: naive.
      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.
class_docstr_tok: ["The","SETR","implementation","based","on","PaddlePaddle",".","The","original","article","refers","to","Zheng",",","Sixiao",",","et","al",".","``","Rethinking","Semantic","Segmentation","from","a","Sequence-to-Sequence","Perspective","with","Transformers","''","(","https",":","\/\/arxiv.org\/abs\/2012.15840",")","Args",":","num_classes","(","int",")",":","The","unique","number","of","target","classes",".","backbone","(","Paddle.nn.Layer",")",":","Backbone","network",".","backbone_indices","(","tuple",")",":","A","tuple","indicates","the","indices","of","output","of","backbone",".","It","can","be","either","one","or","two","values",",","if","two","values",",","the","first","index","will","be","taken","as","a","deep-supervision","feature","in","auxiliary","layer",";","the","second","one","will","be","taken","as","input","of","pixel","representation",".","If","one","value",",","it","is","taken","by","both","above",".","head","(","str",",","optional",")",":","SETR","head","type","(","naive",",","pup","or","mla",")",".","Default",":","naive",".","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,
      backbone_indices=(9, 14, 19, 23),
      head="naive",
      align_corners=False,
      pretrained=None,
      **head_config,
  ):
      super().__init__()
      self.backbone = backbone
      self.num_classes = num_classes
  
      if head.lower() == "naive":
          self.head = NaiveHead(
              num_classes=self.num_classes,
              backbone_indices=backbone_indices,
              in_channels=self.backbone.embed_dim,
              **head_config,
          )
      elif head.lower() == "pup":
          self.head = PUPHead(
              num_classes=self.num_classes,
              backbone_indices=backbone_indices,
              align_corners=align_corners,
              in_channels=self.backbone.embed_dim,
              **head_config,
          )
      elif head.lower() == "mla":
          self.head = MLAHead(
              num_classes=self.num_classes,
              backbone_indices=backbone_indices,
              in_channels=self.backbone.embed_dim,
              **head_config,
          )
      else:
          raise RuntimeError(
              "Unsupported segmentation head type {}. Only naive/pup/mla is valid.".format(
                  head
              )
          )
  
      self.align_corners = align_corners
      self.pretrained = pretrained
      self.init_weight()
  
imports: import paddle.nn
  import paddle.nn.functional
  import paddle
  from paddleseg.cvlibs import manager, param_init
  from paddleseg.models import layers
  from paddleseg.utils import utils
label_desc: Use image node_id 1 to create a new SegmentationTransformer object from inherited base classes: nn with example: obj = SegmentationTransformer(num_classes, backbone, backbone_indices, head, align_corners, pretrained)