class_docstr: The PointHead implementation based on PaddlePaddle.
  
  PointHead use shared multi-layer perceptron (equivalent to
  nn.Conv1D) to predict the logit of input points. The fine-grained feature
  and coarse feature will be concatenate together for predication.
  
  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): Number of classes for logits. Default: 19.
      num_fcs (int, optional): Number of fc layers in the head. Default: 3.
      in_channels (list): input channels of fc block. Default: [256].
      out_channels (int, optional): Fc block's output channels. Default: 256.
      in_index (list): The indexs of input features to use. Default: [0].
      num_points (int, optional): The number of point in training mode. Default: 2048.
      oversample_ratio (int, optional): The sample ratio of points when in training mode.
          sampled_point = num_points * oversample_ratio. Default: 3.
      importance_sample_ratio(float, optional): The importance sample ratio for compute num_uncertain_points. Default: 0.75.
      scale_factor(int, optional): The scale factor of F.interpolate in refine seg logits stage when in inference. Default: 2.
      subdivision_steps(int, optional): Then refine steps in refine seg logits stage when in inference. Default: 2.
      subdivision_num_points(int, optional): The points number for refine seg logits when in inference. Default: 8196.
      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.
      coarse_pred_each_layer(bool, optional): Whether concatenate coarse feature with
          the output of each fc layer. Default: True.
      conv_cfg(str): The config of Conv. Default: 'Conv1D'.
      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: ["The","PointHead","implementation","based","on","PaddlePaddle",".","PointHead","use","shared","multi-layer","perceptron","(","equivalent","to","nn.Conv1D",")","to","predict","the","logit","of","input","points",".","The","fine-grained","feature","and","coarse","feature","will","be","concatenate","together","for","predication",".","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",")",":","Number","of","classes","for","logits",".","Default",":","19.","num_fcs","(","int",",","optional",")",":","Number","of","fc","layers","in","the","head",".","Default",":","3.","in_channels","(","list",")",":","input","channels","of","fc","block",".","Default",":","[","256","]",".","out_channels","(","int",",","optional",")",":","Fc","block","'s","output","channels",".","Default",":","256.","in_index","(","list",")",":","The","indexs","of","input","features","to","use",".","Default",":","[","0","]",".","num_points","(","int",",","optional",")",":","The","number","of","point","in","training","mode",".","Default",":","2048.","oversample_ratio","(","int",",","optional",")",":","The","sample","ratio","of","points","when","in","training","mode",".","sampled_point","=","num_points","*","oversample_ratio",".","Default",":","3.","importance_sample_ratio","(","float",",","optional",")",":","The","importance","sample","ratio","for","compute","num_uncertain_points",".","Default",":","0.75.","scale_factor","(","int",",","optional",")",":","The","scale","factor","of","F.interpolate","in","refine","seg","logits","stage","when","in","inference",".","Default",":","2.","subdivision_steps","(","int",",","optional",")",":","Then","refine","steps","in","refine","seg","logits","stage","when","in","inference",".","Default",":","2.","subdivision_num_points","(","int",",","optional",")",":","The","points","number","for","refine","seg","logits","when","in","inference",".","Default",":","8196.","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.","coarse_pred_each_layer","(","bool",",","optional",")",":","Whether","concatenate","coarse","feature","with","the","output","of","each","fc","layer",".","Default",":","True",".","conv_cfg","(","str",")",":","The","config","of","Conv",".","Default",":","'Conv1D","'",".","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","."]
docstr: Forward function.
  
  Args:
      inputs (list[Tensor]): List of multi-level img features.
      prev_output (Tensor): The output of previous decode head.
  Returns:
      [point_logits,points]: For points loss when in training.
      [refined_seg_logits]: Output refined seg logits when in inference.
code: def forward(self, inputs, prev_output):
      """
      Forward function.
  
      Args:
          inputs (list[Tensor]): List of multi-level img features.
          prev_output (Tensor): The output of previous decode head.
      Returns:
          [point_logits,points]: For points loss when in training.
          [refined_seg_logits]: Output refined seg logits when in inference.
      """
  
      prev_output = prev_output[0]
      x = self._transform_inputs(inputs)
      if self.training:
          return self.forward_train(x, prev_output)
      else:
          refined_seg_logits = prev_output.clone()
          for _ in range(self.subdivision_steps):
              refined_seg_logits = F.interpolate(
                  refined_seg_logits,
                  scale_factor=self.scale_factor,
                  mode="bilinear",
                  align_corners=self.align_corners,
              )
  
              save_shape = paddle.shape(refined_seg_logits)
              point_indices, points = self.get_points_test(
                  refined_seg_logits, calculate_uncertainty
              )
              fine_grained_point_feats = (
                  self._get_fine_grained_point_feats(x, points)
              )
              coarse_point_feats = self._get_coarse_point_feats(
                  prev_output, points
              )
              # forward for inference
              fusion_point_feats = paddle.concat(
                  [fine_grained_point_feats, coarse_point_feats], axis=1
              )
              for fc in self.fcs:
                  fusion_point_feats = fc(fusion_point_feats)
                  if self.coarse_pred_each_layer:
                      fusion_point_feats = paddle.concat(
                          (fusion_point_feats, coarse_point_feats),
                          axis=1,
                      )
              point_logits = self.cls_seg(fusion_point_feats)
              point_indices = paddle.unsqueeze(point_indices, axis=1)
              point_indices = paddle.expand(
                  point_indices, [-1, save_shape[1], -1]
              )
  
              refined_seg_logits = paddle.flatten(refined_seg_logits, 2)
              refined_seg_logits = self.scatter_paddle(
                  refined_seg_logits, point_indices, point_logits
              )  # 2->height * width dim
              refined_seg_logits = refined_seg_logits.reshape(
                  save_shape
              )
          return [refined_seg_logits]
  
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 10 for calling the PointHead obj's underlying member method code with example usage: obj.forward(inputs, prev_output) and returns: self, list