class_docstr: This head is the implementation of "Unified Perceptual Parsing for Scene Understanding".
  This is heavily based on https://github.com/czczup/ViT-Adapter
  
  Args:
      num_classes (int): The unique number of target classes.
      in_channels (list[int]): The channels of input features.
      channels (int, optional): The channels of inter layers in upernet head. Default: 512.
      pool_scales (list, optional): The scales in PPM. Default: [1, 2, 3, 6].
      dropout_ratio (float, optional): The dropout ratio for upernet head. Default: 0.1.
      aux_loss (bool, optional): A bool value indicates whether adding auxiliary loss. Default: True.
      aux_channels (int, optional): The channels of inter layers in auxiliary head. Default: 256.
      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.
class_docstr_tok: ["This","head","is","the","implementation","of","``","Unified","Perceptual","Parsing","for","Scene","Understanding","''",".","This","is","heavily","based","on","https",":","\/\/github.com\/czczup\/ViT-Adapter","Args",":","num_classes","(","int",")",":","The","unique","number","of","target","classes",".","in_channels","(","list","[","int","]",")",":","The","channels","of","input","features",".","channels","(","int",",","optional",")",":","The","channels","of","inter","layers","in","upernet","head",".","Default",":","512.","pool_scales","(","list",",","optional",")",":","The","scales","in","PPM",".","Default",":","[","1",",","2",",","3",",","6","]",".","dropout_ratio","(","float",",","optional",")",":","The","dropout","ratio","for","upernet","head",".","Default",":","0.1.","aux_loss","(","bool",",","optional",")",":","A","bool","value","indicates","whether","adding","auxiliary","loss",".","Default",":","True",".","aux_channels","(","int",",","optional",")",":","The","channels","of","inter","layers","in","auxiliary","head",".","Default",":","256.","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","."]
code: def forward(self, inputs):
      # build laterals
      laterals = [
          lateral_conv(inputs[i])
          for i, lateral_conv in enumerate(self.lateral_convs)
      ]
      laterals.append(self.psp_forward(inputs))
  
      # build top-down path
      used_backbone_levels = len(laterals)
      for i in range(used_backbone_levels - 1, 0, -1):
          upsampled = F.interpolate(
              laterals[i],
              paddle.shape(laterals[i - 1])[2:],
              mode="bilinear",
              align_corners=self.align_corners,
          )
          laterals[i - 1] = laterals[i - 1] + upsampled
  
      # build outputs
      fpn_outs = [
          self.fpn_convs[i](laterals[i])
          for i in range(used_backbone_levels - 1)
      ]
      fpn_outs.append(laterals[-1])  # append psp feature
  
      for i in range(used_backbone_levels - 1, 0, -1):
          fpn_outs[i] = F.interpolate(
              fpn_outs[i],
              size=paddle.shape(fpn_outs[0])[2:],
              mode="bilinear",
              align_corners=self.align_corners,
          )
      fpn_outs = paddle.concat(fpn_outs, axis=1)
      output = self.fpn_bottleneck(fpn_outs)
  
      if self.dropout is not None:
          output = self.dropout(output)
      output = self.conv_seg(output)
      logits_list = [output]
  
      if self.aux_loss and self.training:
          aux_output = self.aux_conv(inputs[2])
          aux_output = self.aux_conv_seg(aux_output)
          logits_list.append(aux_output)
  
      return logits_list
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg import utils
  from paddleseg.cvlibs import manager
  from paddleseg.models import layers
label_desc: Use image node_id 3 for calling the UPerNetHead obj's underlying member method code with example usage: obj.forward(inputs) and returns: logits_list