class_docstr: Fully Convolution Networks for Semantic Segmentation.
  
  This head is implemented of `FCNNet <https://arxiv.org/abs/1411.4038>`_.
  
  Args:
      num_convs (int): Number of convs in the head. Default: 2.
      kernel_size (int): The kernel size for convs in the head. Default: 3.
      concat_input (bool): Whether concat the input and output of convs
          before classification layer.
      dilation (int): The dilation rate for convs in the head. Default: 1.
code: def __init__(
      self,
      num_convs=2,
      kernel_size=3,
      concat_input=True,
      dilation=1,
      **kwargs,
  ):
      assert (
          num_convs >= 0 and dilation > 0 and isinstance(dilation, int)
      )
      self.num_convs = num_convs
      self.concat_input = concat_input
      self.kernel_size = kernel_size
      super(FCNHead, self).__init__(**kwargs)
      if num_convs == 0:
          assert self.in_channels == self.channels
  
      conv_padding = (kernel_size // 2) * dilation
      convs = []
      convs.append(
          ConvModule(
              self.in_channels,
              self.channels,
              kernel_size=kernel_size,
              padding=conv_padding,
              dilation=dilation,
              conv_cfg=self.conv_cfg,
              norm_cfg=self.norm_cfg,
              act_cfg=self.act_cfg,
          )
      )
      for i in range(num_convs - 1):
          convs.append(
              ConvModule(
                  self.channels,
                  self.channels,
                  kernel_size=kernel_size,
                  padding=conv_padding,
                  dilation=dilation,
                  conv_cfg=self.conv_cfg,
                  norm_cfg=self.norm_cfg,
                  act_cfg=self.act_cfg,
              )
          )
      if num_convs == 0:
          self.convs = nn.Identity()
      else:
          self.convs = nn.Sequential(*convs)
      if self.concat_input:
          self.conv_cat = ConvModule(
              self.in_channels + self.channels,
              self.channels,
              kernel_size=kernel_size,
              padding=kernel_size // 2,
              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/fcn_head.py
imports: import torch
  import torch.nn
  from annotator.uniformer.mmcv.cnn import ConvModule
  from ..builder import HEADS
  from .decode_head import BaseDecodeHead
label_desc: Use image node_id 1 to create a new FCNHead object from inherited base classes: BaseDecodeHead with example: obj = FCNHead(num_convs, kernel_size, concat_input, dilation)