class_docstr: The STDCSeg implementation based on PaddlePaddle.
  
  The original article refers to Meituan
  Fan, Mingyuan, et al. "Rethinking BiSeNet For Real-time Semantic Segmentation."
  (https://arxiv.org/abs/2104.13188)
  
  Args:
      num_classes(int,optional): The unique number of target classes.
      use_boundary_8(bool,non-optional): Whether to use detail loss. it should be True accroding to paper for best metric. Default: True.
      Actually,if you want to use _boundary_2/_boundary_4/_boundary_16,you should append loss function number of DetailAggregateLoss.It should work properly.
      use_conv_last(bool,optional): Determine ContextPath 's inplanes variable according to whether to use bockbone's last conv. Default: False.
      pretrained (str, optional): The path or url of pretrained model. Default: None.
class_docstr_tok: ["The","STDCSeg","implementation","based","on","PaddlePaddle",".","The","original","article","refers","to","Meituan","Fan",",","Mingyuan",",","et","al",".","``","Rethinking","BiSeNet","For","Real-time","Semantic","Segmentation",".","''","(","https",":","\/\/arxiv.org\/abs\/2104.13188",")","Args",":","num_classes","(","int",",","optional",")",":","The","unique","number","of","target","classes",".","use_boundary_8","(","bool",",","non-optional",")",":","Whether","to","use","detail","loss",".","it","should","be","True","accroding","to","paper","for","best","metric",".","Default",":","True",".","Actually",",","if","you","want","to","use","_boundary_2\/_boundary_4\/_boundary_16",",","you","should","append","loss","function","number","of","DetailAggregateLoss.It","should","work","properly",".","use_conv_last","(","bool",",","optional",")",":","Determine","ContextPath","'s","inplanes","variable","according","to","whether","to","use","bockbone","'s","last","conv",".","Default",":","False",".","pretrained","(","str",",","optional",")",":","The","path","or","url","of","pretrained","model",".","Default",":","None","."]
code: def __init__(
      self,
      num_classes: int = 19,
      use_boundary_2: bool = False,
      use_boundary_4: bool = False,
      use_boundary_8: bool = True,
      use_boundary_16: bool = False,
      use_conv_last: bool = False,
      pretrained: str = None,
  ):
      super(STDCSeg, self).__init__()
  
      self.use_boundary_2 = use_boundary_2
      self.use_boundary_4 = use_boundary_4
      self.use_boundary_8 = use_boundary_8
      self.use_boundary_16 = use_boundary_16
      self.cp = ContextPath(STDC1(), use_conv_last=use_conv_last)
      self.ffm = FeatureFusionModule(384, 256)
      self.conv_out = SegHead(256, 256, num_classes)
      self.conv_out8 = SegHead(128, 64, num_classes)
      self.conv_out16 = SegHead(128, 64, num_classes)
      self.conv_out_sp16 = SegHead(512, 64, 1)
      self.conv_out_sp8 = SegHead(256, 64, 1)
      self.conv_out_sp4 = SegHead(64, 64, 1)
      self.conv_out_sp2 = SegHead(32, 64, 1)
      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, "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 numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddlehub.module.module import moduleinfo
  import paddlehub.vision.segmentation_transforms
  from paddlehub.module.cv_module import ImageSegmentationModule
  from stdc1_seg_voc.stdcnet import STDC1
  import stdc1_seg_voc.layers
label_desc: Use image node_id 1 to create a new STDCSeg object from inherited base classes: nn with example: obj = STDCSeg(num_classes, use_boundary_2, use_boundary_4, use_boundary_8, use_boundary_16, use_conv_last, pretrained)