class_docstr: The DeepLabV3PResnet50 implementation based on PaddlePaddle.
  
  The original article refers to
   Liang-Chieh Chen, et, al. "Encoder-Decoder with Atrous Separable Convolution for Semantic Image Segmentation"
   (https://arxiv.org/abs/1802.02611)
  
  Args:
      num_classes (int): the unique number of target classes.
      backbone_indices (tuple): two values in the tuple indicate the indices of output of backbone.
          the first index will be taken as a low-level feature in Decoder component;
          the second one will be taken as input of ASPP component.
          Usually backbone consists of four downsampling stage, and return an output of
          each stage, so we set default (0, 3), which means taking feature map of the first
          stage in backbone as low-level feature used in Decoder, and feature map of the fourth
          stage as input of ASPP.
      aspp_ratios (tuple): the dilation rate using in ASSP module.
          if output_stride=16, aspp_ratios should be set as (1, 6, 12, 18).
          if output_stride=8, aspp_ratios is (1, 12, 24, 36).
      aspp_out_channels (int): the output channels of ASPP module.
      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): the path of pretrained model. Default to None.
class_docstr_tok: ["The","DeepLabV3PResnet50","implementation","based","on","PaddlePaddle",".","The","original","article","refers","to","Liang-Chieh","Chen",",","et",",","al",".","``","Encoder-Decoder","with","Atrous","Separable","Convolution","for","Semantic","Image","Segmentation","''","(","https",":","\/\/arxiv.org\/abs\/1802.02611",")","Args",":","num_classes","(","int",")",":","the","unique","number","of","target","classes",".","backbone_indices","(","tuple",")",":","two","values","in","the","tuple","indicate","the","indices","of","output","of","backbone",".","the","first","index","will","be","taken","as","a","low-level","feature","in","Decoder","component",";","the","second","one","will","be","taken","as","input","of","ASPP","component",".","Usually","backbone","consists","of","four","downsampling","stage",",","and","return","an","output","of","each","stage",",","so","we","set","default","(","0",",","3",")",",","which","means","taking","feature","map","of","the","first","stage","in","backbone","as","low-level","feature","used","in","Decoder",",","and","feature","map","of","the","fourth","stage","as","input","of","ASPP",".","aspp_ratios","(","tuple",")",":","the","dilation","rate","using","in","ASSP","module",".","if","output_stride=16",",","aspp_ratios","should","be","set","as","(","1",",","6",",","12",",","18",")",".","if","output_stride=8",",","aspp_ratios","is","(","1",",","12",",","24",",","36",")",".","aspp_out_channels","(","int",")",":","the","output","channels","of","ASPP","module",".","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",")",":","the","path","of","pretrained","model",".","Default","to","None","."]
code: def __init__(
      self,
      num_classes: int = 21,
      backbone_indices: Tuple[int] = (0, 3),
      aspp_ratios: Tuple[int] = (1, 12, 24, 36),
      aspp_out_channels: int = 256,
      align_corners=False,
      pretrained: str = None,
  ):
      super(DeepLabV3PResnet50, self).__init__()
      self.backbone = ResNet50_vd()
      backbone_channels = [
          self.backbone.feat_channels[i] for i in backbone_indices
      ]
      self.head = DeepLabV3PHead(
          num_classes,
          backbone_indices,
          backbone_channels,
          aspp_ratios,
          aspp_out_channels,
          align_corners,
      )
      self.align_corners = align_corners
      self.transforms = T.Compose([T.Normalize()])
  
      if pretrained is not None:
          model_dict = paddle.load(pretrained)
          self.set_dict(model_dict)
          print("load custom parameters success")
  
      else:
          checkpoint = os.path.join(
              self.directory, "deeplabv3p_model.pdparams"
          )
          model_dict = paddle.load(checkpoint)
          self.set_dict(model_dict)
          print("load pretrained parameters success")
  
imports: import os
  from typing import Union, List, Tuple
  import paddle
  from paddle import nn
  import paddle.nn.functional
  import numpy
  from paddlehub.module.module import moduleinfo
  import paddlehub.vision.segmentation_transforms
  from paddlehub.module.cv_module import ImageSegmentationModule
  from deeplabv3p_resnet50_voc.resnet import ResNet50_vd
  import deeplabv3p_resnet50_voc.layers
label_desc: Use image node_id 1 to create a new DeepLabV3PResnet50 object from inherited base classes: nn with example: obj = DeepLabV3PResnet50(num_classes, backbone_indices, aspp_ratios, aspp_out_channels, align_corners, pretrained)