class_docstr: The SemanticFPN-PointRend implementation based on PaddlePaddle.
  
  The original article refers to
  Kirillov A, Wu Y, He K, et al. "PointRend: Image Segmentation As Rendering."
  (https://arxiv.org/abs/1912.08193).
  
  Args:
      num_classes (int): The unique number of target classes.
      backbone (Paddle.nn.Layer): Backbone network, currently support Resnet50/101.
      backbone_indices (tuple, optional): Four values in the tuple indicate the indices of output of backbone.
      fpn_inplanes (list, optional): Input channels list(the feature channels from backbone) for lateral_conv constraction in FPN. Default: [256, 512, 1024, 2048].
      fpn_outplanes (int, optional): The output channels in FPN. Default: 256.
      point_num_fcs (int, optional): Number of fc layers in the head in PointHead. Default: 3.
      point_in_channels (list, optional): input channels of fc block in PointHead. Default: [256].
      point_out_channels (int, optional): Fc block's output channels in PointHead. Default: 256.
      point_in_index (list, optional): The indexs of input features to use in PointHead. Default: [0].
      point_num_points (int, optional): The number of point in training mode in PointHead. Default: 2048.
      point_oversample_ratio (int, optional): The sample ratio of points when in training mode in PointHead.
          sampled_point = num_points * oversample_ratio. Default: 3.
      point_importance_sample_ratio (float, optional): The importance sample ratio for compute num_uncertain_points in PointHead. Default: 0.75.
      point_scale_factor(int, optinal): The scale factor of F.interpolate in refine seg logits stage when in inference in PointHead. Default: 2.
      point_subdivision_steps(int, optional): Then refine steps in refine seg logits stage when in inference in PointHead. Default: 2.
      point_subdivision_num_points(int, optional): The points number for refine seg logits when in inference in PointHead. Default: 8196.
      point_dropout_ratio(float, optional): If the dropout_ratio >0, to use Dropout before output and the p of dropout is dropout_ratio in PointHead. Default: 0.1.
      point_coarse_pred_each_layer(bool, optional): Whether concatenate coarse feature with
          the output of each fc layer in PointHead. Default: True.
      point_conv_cfg(str): The config of Conv in PointHead. Default: 'Conv1D'.
      point_input_transform(str): The features transform method of inputs in PointHead.
          it can be found in function '_transform_inputs'. Defalut: 'multiple_select'.
      PFN_feature_strides(list): The strides for input feature maps and all strides suppose to be power of 2 in FPNHead. The first
          one is of largest resolution. Default: [4, 8, 16, 32].
      PFN_in_channels(list): The input feature's channels list in FPNHead. Default: [256, 256, 256, 256].
      PFN_channels(int,optional): The output channels of scale_head's Conv before Upsample block in FPNHead. Default: 128.
      PFN_in_index(list): The indexs of input features to use. it's shape should keep with in_channels in FPNHead. Default: [0, 1, 2, 3].
      PFN_dropout_ratio(float,optional): If the dropout_ratio >0, to use Dropout before output and the p of dropout is dropout_ratio in FPNHead. Default: 0.1.
      PFN_conv_cfg(str): The config of Conv. Default: 'Conv2D'.
      PFN_input_transform(str): The features transform method of inputs. it can be found in function '_transform_inputs' in FPNHead. 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.
      pretrained (str, optional): The path or url of pretrained model. Default: None.
class_docstr_tok: ["The","SemanticFPN-PointRend","implementation","based","on","PaddlePaddle",".","The","original","article","refers","to","Kirillov","A",",","Wu","Y",",","He","K",",","et","al",".","``","PointRend",":","Image","Segmentation","As","Rendering",".","''","(","https",":","\/\/arxiv.org\/abs\/1912.08193",")",".","Args",":","num_classes","(","int",")",":","The","unique","number","of","target","classes",".","backbone","(","Paddle.nn.Layer",")",":","Backbone","network",",","currently","support","Resnet50\/101",".","backbone_indices","(","tuple",",","optional",")",":","Four","values","in","the","tuple","indicate","the","indices","of","output","of","backbone",".","fpn_inplanes","(","list",",","optional",")",":","Input","channels","list","(","the","feature","channels","from","backbone",")","for","lateral_conv","constraction","in","FPN",".","Default",":","[","256",",","512",",","1024",",","2048","]",".","fpn_outplanes","(","int",",","optional",")",":","The","output","channels","in","FPN",".","Default",":","256.","point_num_fcs","(","int",",","optional",")",":","Number","of","fc","layers","in","the","head","in","PointHead",".","Default",":","3.","point_in_channels","(","list",",","optional",")",":","input","channels","of","fc","block","in","PointHead",".","Default",":","[","256","]",".","point_out_channels","(","int",",","optional",")",":","Fc","block","'s","output","channels","in","PointHead",".","Default",":","256.","point_in_index","(","list",",","optional",")",":","The","indexs","of","input","features","to","use","in","PointHead",".","Default",":","[","0","]",".","point_num_points","(","int",",","optional",")",":","The","number","of","point","in","training","mode","in","PointHead",".","Default",":","2048.","point_oversample_ratio","(","int",",","optional",")",":","The","sample","ratio","of","points","when","in","training","mode","in","PointHead",".","sampled_point","=","num_points","*","oversample_ratio",".","Default",":","3.","point_importance_sample_ratio","(","float",",","optional",")",":","The","importance","sample","ratio","for","compute","num_uncertain_points","in","PointHead",".","Default",":","0.75.","point_scale_factor","(","int",",","optinal",")",":","The","scale","factor","of","F.interpolate","in","refine","seg","logits","stage","when","in","inference","in","PointHead",".","Default",":","2.","point_subdivision_steps","(","int",",","optional",")",":","Then","refine","steps","in","refine","seg","logits","stage","when","in","inference","in","PointHead",".","Default",":","2.","point_subdivision_num_points","(","int",",","optional",")",":","The","points","number","for","refine","seg","logits","when","in","inference","in","PointHead",".","Default",":","8196.","point_dropout_ratio","(","float",",","optional",")",":","If","the","dropout_ratio",">","0",",","to","use","Dropout","before","output","and","the","p","of","dropout","is","dropout_ratio","in","PointHead",".","Default",":","0.1.","point_coarse_pred_each_layer","(","bool",",","optional",")",":","Whether","concatenate","coarse","feature","with","the","output","of","each","fc","layer","in","PointHead",".","Default",":","True",".","point_conv_cfg","(","str",")",":","The","config","of","Conv","in","PointHead",".","Default",":","'Conv1D","'",".","point_input_transform","(","str",")",":","The","features","transform","method","of","inputs","in","PointHead",".","it","can","be","found","in","function","'_transform_inputs","'",".","Defalut",":","'multiple_select","'",".","PFN_feature_strides","(","list",")",":","The","strides","for","input","feature","maps","and","all","strides","suppose","to","be","power","of","2","in","FPNHead",".","The","first","one","is","of","largest","resolution",".","Default",":","[","4",",","8",",","16",",","32","]",".","PFN_in_channels","(","list",")",":","The","input","feature","'s","channels","list","in","FPNHead",".","Default",":","[","256",",","256",",","256",",","256","]",".","PFN_channels","(","int",",","optional",")",":","The","output","channels","of","scale_head","'s","Conv","before","Upsample","block","in","FPNHead",".","Default",":","128",".","PFN_in_index","(","list",")",":","The","indexs","of","input","features","to","use",".","it","'s","shape","should","keep","with","in_channels","in","FPNHead",".","Default",":","[","0",",","1",",","2",",","3","]",".","PFN_dropout_ratio","(","float",",","optional",")",":","If","the","dropout_ratio",">","0",",","to","use","Dropout","before","output","and","the","p","of","dropout","is","dropout_ratio","in","FPNHead",".","Default",":","0.1",".","PFN_conv_cfg","(","str",")",":","The","config","of","Conv",".","Default",":","'Conv2D","'",".","PFN_input_transform","(","str",")",":","The","features","transform","method","of","inputs",".","it","can","be","found","in","function","'_transform_inputs","'","in","FPNHead",".","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",".","pretrained","(","str",",","optional",")",":","The","path","or","url","of","pretrained","model",".","Default",":","None","."]
code: def __init__(
      self,
      num_classes,
      backbone,
      backbone_indices,
      fpn_inplanes=[256, 512, 1024, 2048],
      fpn_outplanes=256,
      point_in_channels=[256],
      point_out_channels=256,
      point_in_index=[0],
      point_num_fcs=3,
      point_num_points=2048,
      point_oversample_ratio=3,
      point_importance_sample_ratio=0.75,
      point_scale_factor=2,
      point_subdivision_steps=2,
      point_subdivision_num_points=8196,
      point_dropout_ratio=0,
      point_coarse_pred_each_layer=True,
      point_input_transform="multiple_select",  # resize_concat
      point_conv_cfg="Conv1D",
      PFN_feature_strides=[4, 8, 16, 32],
      PFN_in_channels=[256, 256, 256, 256],
      PFN_channels=128,
      PFN_in_index=[0, 1, 2, 3],
      PFN_dropout_ratio=0,
      PFN_conv_cfg="Conv2D",
      PFN_input_transform="multiple_select",
      align_corners=False,
      pretrained=None,
  ):
      super(PointRend, self).__init__()
      self.backbone = backbone
      self.backbone_indices = backbone_indices
      self.in_channels = [
          self.backbone.feat_channels[i] for i in backbone_indices
      ]
  
      self.neck = FPNNeck(
          fpn_inplanes=fpn_inplanes, fpn_outplanes=fpn_outplanes
      )
      self.pointhead = PointHead(
          in_channels=point_in_channels,
          out_channels=point_out_channels,
          num_classes=num_classes,
          in_index=point_in_index,
          num_fcs=point_num_fcs,
          num_points=point_num_points,
          oversample_ratio=point_oversample_ratio,
          importance_sample_ratio=point_importance_sample_ratio,
          scale_factor=point_scale_factor,
          subdivision_steps=point_subdivision_steps,
          subdivision_num_points=point_subdivision_num_points,
          dropout_ratio=point_dropout_ratio,
          align_corners=align_corners,
          coarse_pred_each_layer=point_coarse_pred_each_layer,
          input_transform=point_input_transform,  # resize_concat
          conv_cfg=point_conv_cfg,
      )
      self.fpnhead = FPNHead(
          feature_strides=PFN_feature_strides,
          in_channels=PFN_in_channels,
          channels=PFN_channels,
          num_class=num_classes,
          in_index=PFN_in_index,
          dropout_ratio=PFN_dropout_ratio,
          conv_cfg=PFN_conv_cfg,
          input_transform=PFN_input_transform,
          align_corners=align_corners,
      )
  
      self.align_corners = align_corners
      self.pretrained = pretrained
      self.init_weight()
  
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 PointRend object from inherited base classes: nn with example: obj = PointRend(num_classes, backbone, backbone_indices, fpn_inplanes, fpn_outplanes, point_in_channels, point_out_channels, point_in_index, point_num_fcs, point_num_points, point_oversample_ratio, point_importance_sample_ratio, point_scale_factor, point_subdivision_steps, point_subdivision_num_points, point_dropout_ratio, point_coarse_pred_each_layer, point_input_transform, point_conv_cfg, PFN_feature_strides, PFN_in_channels, PFN_channels, PFN_in_index, PFN_dropout_ratio, PFN_conv_cfg, PFN_input_transform, align_corners, pretrained)