class_docstr: The BiSeNet V2 implementation based on PaddlePaddle.
  
  The original article refers to
  Yu, Changqian, et al. "BiSeNet V2: Bilateral Network with Guided Aggregation for Real-time Semantic Segmentation"
  (https://arxiv.org/abs/2004.02147)
  
  Args:
      num_classes (int): The unique number of target classes, default is 19.
      lambd (float, optional): A factor for controlling the size of semantic branch channels. Default: 0.25.
      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","BiSeNet","V2","implementation","based","on","PaddlePaddle",".","The","original","article","refers","to","Yu",",","Changqian",",","et","al",".","``","BiSeNet","V2",":","Bilateral","Network","with","Guided","Aggregation","for","Real-time","Semantic","Segmentation","''","(","https",":","\/\/arxiv.org\/abs\/2004.02147",")","Args",":","num_classes","(","int",")",":","The","unique","number","of","target","classes",",","default","is","19.","lambd","(","float",",","optional",")",":","A","factor","for","controlling","the","size","of","semantic","branch","channels",".","Default",":","0.25.","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: int = 19,
      lambd: float = 0.25,
      align_corners: bool = False,
      pretrained: str = None,
  ):
      super(BiSeNetV2, self).__init__()
  
      C1, C2, C3 = 64, 64, 128
      db_channels = (C1, C2, C3)
      C1, C3, C4, C5 = int(C1 * lambd), int(C3 * lambd), 64, 128
      sb_channels = (C1, C3, C4, C5)
      mid_channels = 128
  
      self.db = DetailBranch(db_channels)
      self.sb = SemanticBranch(sb_channels)
  
      self.bga = BGA(mid_channels, align_corners)
      self.aux_head1 = SegHead(C1, C1, num_classes)
      self.aux_head2 = SegHead(C3, C3, num_classes)
      self.aux_head3 = SegHead(C4, C4, num_classes)
      self.aux_head4 = SegHead(C5, C5, num_classes)
      self.head = SegHead(mid_channels, mid_channels, num_classes)
  
      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, "bisenet_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
  import bisenet_cityscapes.layers
label_desc: Use image node_id 1 to create a new BiSeNetV2 object from inherited base classes: nn with example: obj = BiSeNetV2(num_classes, lambd, align_corners, pretrained)