class_docstr: The SeaFormer implementation based on PaddlePaddle.
  
  The original article refers to
  Qiang Wang, et, al. "SEAFORMER: SQUEEZE-ENHANCED AXIAL TRANSFORMER FOR MOBILE SEMANTIC SEGMENTATION"
  (https://arxiv.org/pdf/2301.13156.pdf).
  
  Args:
      backbone (Paddle.nn.Layer): Backbone network, currently support SeaFormer.
      in_index (list, optional): Two values in the tuple indicate the indices of output of backbone. Defaulte: [0, 1, 2]
      head_channels (int, optional): Number of channels of segmentation head. Default: 160.
      embed_dims (list, optional): The size of embedding dimensions. Default: [128, 160].
      num_classes (int, optional): The unique number of target classes. Default: 150.
      is_dw (bool, optional): An argument of using head_channels as group of Conv2D. Default: True.
      align_corners (bool, optional): An argument of F.interpolate. It should be set to False when the feature size is even,
          e.g. 1024x512, otherwise it is True, e.g. 769x769. Default: False.
      input_transform (str, optional): An argument of data format backbone's output. Default: 'multiple_select'.
      pretrained (str, optional): The path or url of pretrained model. Default: None.
class_docstr_tok: ["The","SeaFormer","implementation","based","on","PaddlePaddle",".","The","original","article","refers","to","Qiang","Wang",",","et",",","al",".","``","SEAFORMER",":","SQUEEZE-ENHANCED","AXIAL","TRANSFORMER","FOR","MOBILE","SEMANTIC","SEGMENTATION","''","(","https",":","\/\/arxiv.org\/pdf\/2301.13156.pdf",")",".","Args",":","backbone","(","Paddle.nn.Layer",")",":","Backbone","network",",","currently","support","SeaFormer",".","in_index","(","list",",","optional",")",":","Two","values","in","the","tuple","indicate","the","indices","of","output","of","backbone",".","Defaulte",":","[","0",",","1",",","2","]","head_channels","(","int",",","optional",")",":","Number","of","channels","of","segmentation","head",".","Default",":","160.","embed_dims","(","list",",","optional",")",":","The","size","of","embedding","dimensions",".","Default",":","[","128",",","160","]",".","num_classes","(","int",",","optional",")",":","The","unique","number","of","target","classes",".","Default",":","150.","is_dw","(","bool",",","optional",")",":","An","argument","of","using","head_channels","as","group","of","Conv2D",".","Default",":","True",".","align_corners","(","bool",",","optional",")",":","An","argument","of","F.interpolate",".","It","should","be","set","to","False","when","the","feature","size","is","even",",","e.g",".","1024x512",",","otherwise","it","is","True",",","e.g",".","769x769",".","Default",":","False",".","input_transform","(","str",",","optional",")",":","An","argument","of","data","format","backbone","'s","output",".","Default",":","'multiple_select","'",".","pretrained","(","str",",","optional",")",":","The","path","or","url","of","pretrained","model",".","Default",":","None","."]
code: def __init__(
      self,
      backbone,
      in_index=[0, 1, 2],
      head_channels=160,
      embed_dims=[128, 160],
      num_classes=150,
      is_dw=True,
      dropout_ratio=0.1,
      align_corners=False,
      input_transform="multiple_select",
      pretrained=None,
  ):
      super().__init__()
      self.head_channels = head_channels
      self.backbone = backbone
      in_channels = backbone.feat_channels
  
      self.in_index = in_index
      self.input_transform = input_transform
      self.align_corners = align_corners
  
      self.embed_dims = embed_dims
      self.pretrained = pretrained
  
      self.linear_fuse = layers.ConvBNReLU(
          self.head_channels,
          self.head_channels,
          1,
          stride=1,
          groups=self.head_channels if is_dw else 1,
          bias_attr=False,
      )
      if dropout_ratio > 0:
          self.dropout = nn.Dropout2D(dropout_ratio)
  
      self.cls_seg = nn.Conv2D(
          self.head_channels, num_classes, kernel_size=1
      )
  
      for i in range(len(embed_dims)):
          fuse = FusionBlock(
              in_channels[0] if i == 0 else embed_dims[i - 1],
              in_channels[i + 1],
              embed_dim=embed_dims[i],
          )
          setattr(self, f"fuse{i + 1}", fuse)
  
      self.init_weight()
  
file_path: PaddleSeg/paddleseg/models/seaformer_seg.py
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  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 SeaFormerSeg object from inherited base classes: nn with example: obj = SeaFormerSeg(backbone, in_index, head_channels, embed_dims, num_classes, is_dw, dropout_ratio, align_corners, input_transform, pretrained)