class_docstr: Unified Perceptual Parsing for Scene Understanding.
  
  This head is the implementation of `UPerNet
  <https://arxiv.org/abs/1807.10221>`_.
  
  Args:
      pool_scales (tuple[int]): Pooling scales used in Pooling Pyramid
          Module applied on the last feature. Default: (1, 2, 3, 6).
class_docstr_tok: ["Unified","Perceptual","Parsing","for","Scene","Understanding",".","This","head","is","the","implementation","of","`","UPerNet","<","https",":","\/\/arxiv.org\/abs\/1807.10221",">","`","_",".","Args",":","pool_scales","(","tuple","[","int","]",")",":","Pooling","scales","used","in","Pooling","Pyramid","Module","applied","on","the","last","feature",".","Default",":","(","1",",","2",",","3",",","6",")","."]
code: def __init__(self, pool_scales=(1, 2, 3, 6), **kwargs):
      super(UPerHead, self).__init__(
          input_transform="multiple_select", **kwargs
      )
      # PSP Module
      self.psp_modules = PPM(
          pool_scales,
          self.in_channels[-1],
          self.channels,
          conv_cfg=self.conv_cfg,
          norm_cfg=self.norm_cfg,
          act_cfg=self.act_cfg,
          align_corners=self.align_corners,
      )
      self.bottleneck = ConvModule(
          self.in_channels[-1] + len(pool_scales) * self.channels,
          self.channels,
          3,
          padding=1,
          conv_cfg=self.conv_cfg,
          norm_cfg=self.norm_cfg,
          act_cfg=self.act_cfg,
      )
      # FPN Module
      self.lateral_convs = nn.ModuleList()
      self.fpn_convs = nn.ModuleList()
      for in_channels in self.in_channels[:-1]:  # skip the top layer
          l_conv = ConvModule(
              in_channels,
              self.channels,
              1,
              conv_cfg=self.conv_cfg,
              norm_cfg=self.norm_cfg,
              act_cfg=self.act_cfg,
              inplace=False,
          )
          fpn_conv = ConvModule(
              self.channels,
              self.channels,
              3,
              padding=1,
              conv_cfg=self.conv_cfg,
              norm_cfg=self.norm_cfg,
              act_cfg=self.act_cfg,
              inplace=False,
          )
          self.lateral_convs.append(l_conv)
          self.fpn_convs.append(fpn_conv)
  
      self.fpn_bottleneck = ConvModule(
          len(self.in_channels) * self.channels,
          self.channels,
          3,
          padding=1,
          conv_cfg=self.conv_cfg,
          norm_cfg=self.norm_cfg,
          act_cfg=self.act_cfg,
      )
  
file_path: lavis/lavis/common/annotator/uniformer/mmseg/models/decode_heads/uper_head.py
imports: import torch
  import torch.nn
  from annotator.uniformer.mmcv.cnn import ConvModule
  from annotator.uniformer.mmseg.ops import resize
  from ..builder import HEADS
  from .decode_head import BaseDecodeHead
  from .psp_head import PPM
label_desc: Use image node_id 1 to create a new UPerHead object from inherited base classes: BaseDecodeHead with example: obj = UPerHead(pool_scales)