class_docstr: This head is the implementation of Semantic FPN in paddle.
  
  The original article refers to:
  Kirillov, A. , et al. "Panoptic Feature Pyramid Networks."
  (https://arxiv.org/abs/1901.02446)
  
  Args:
      num_classes(int): The unique number of target classes. Default: 19.
      feature_strides(list): The strides for input feature maps and all strides suppose to be power of 2. The first
          one is of largest resolution. Default: [4, 8, 16, 32].
      in_channels(list): The input feature's channels list. Default: [256, 256, 256, 256].
      channels(int, optional): The output channels of scale_head's Conv before Upsample block. Default: 128.
      in_index(list): The indexs of input features to use. it's shape should keep with in_channels. Default: [0, 1, 2, 3].
      dropout_ratio(float, optional): If the dropout_ratio >0, to use Dropout before output and the p of dropout is dropout_ratio. Default: 0.1.
      conv_cfg(str): The config of Conv. Default: 'Conv2D'.
      input_transform(str): The features transform method of inputs. it can be found in function '_transform_inputs'. Defalut: 'multiple_select'.
      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","Semantic","FPN","in","paddle",".","The","original","article","refers","to",":","Kirillov",",","A.",",","et","al",".","``","Panoptic","Feature","Pyramid","Networks",".","''","(","https",":","\/\/arxiv.org\/abs\/1901.02446",")","Args",":","num_classes","(","int",")",":","The","unique","number","of","target","classes",".","Default",":","19.","feature_strides","(","list",")",":","The","strides","for","input","feature","maps","and","all","strides","suppose","to","be","power","of","2",".","The","first","one","is","of","largest","resolution",".","Default",":","[","4",",","8",",","16",",","32","]",".","in_channels","(","list",")",":","The","input","feature","'s","channels","list",".","Default",":","[","256",",","256",",","256",",","256","]",".","channels","(","int",",","optional",")",":","The","output","channels","of","scale_head","'s","Conv","before","Upsample","block",".","Default",":","128.","in_index","(","list",")",":","The","indexs","of","input","features","to","use",".","it","'s","shape","should","keep","with","in_channels",".","Default",":","[","0",",","1",",","2",",","3","]",".","dropout_ratio","(","float",",","optional",")",":","If","the","dropout_ratio",">","0",",","to","use","Dropout","before","output","and","the","p","of","dropout","is","dropout_ratio",".","Default",":","0.1.","conv_cfg","(","str",")",":","The","config","of","Conv",".","Default",":","'Conv2D","'",".","input_transform","(","str",")",":","The","features","transform","method","of","inputs",".","it","can","be","found","in","function","'_transform_inputs","'",".","Defalut",":","'multiple_select","'",".","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 __init__(
      self,
      num_class=19,
      feature_strides=[4, 8, 16, 32],
      in_channels=[256, 256, 256, 256],
      channels=128,
      in_index=[0, 1, 2, 3],
      dropout_ratio=0.1,
      conv_cfg="Conv2D",
      input_transform="multiple_select",
      align_corners=False,
  ):
      super(FPNHead, self).__init__()
      assert len(feature_strides) == len(in_channels)
      assert min(feature_strides) == feature_strides[0]
      self.feature_strides = feature_strides
      self.in_channels = in_channels
      self.channels = channels
      self.in_index = in_index
      self.num_class = num_class
      self.conv_cfg = conv_cfg
      self.dropout_ratio = dropout_ratio
      self.input_transform = input_transform
      self.align_corners = align_corners
      self.scale_heads = nn.LayerList()
  
      for i in range(len(feature_strides)):
          head_length = max(
              1,
              int(
                  np.log2(feature_strides[i])
                  - np.log2(feature_strides[0])
              ),
          )
          scale_head = []
          for k in range(head_length):
              scale_head.append(
                  ConvModule(
                      self.in_channels[i] if k == 0 else self.channels,
                      self.channels,
                      3,
                      padding=1,
                      conv_cfg=self.conv_cfg,
                  )
              )
              if feature_strides[i] != feature_strides[0]:
                  scale_head.append(
                      Upsample(
                          scale_factor=2,
                          mode="bilinear",
                          align_corners=self.align_corners,
                      )
                  )
          self.scale_heads.append(nn.Sequential(*scale_head))
  
      self.conv_seg = nn.Conv2D(
          self.channels, self.num_class, kernel_size=1
      )
  
      if self.dropout_ratio is not None:
          self.dropout = nn.Dropout2D(self.dropout_ratio)
      else:
          self.dropout = None
  
imports: import numpy
  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 FPNHead object from inherited base classes: nn with example: obj = FPNHead(num_class, feature_strides, in_channels, channels, in_index, dropout_ratio, conv_cfg, input_transform, align_corners)