class_docstr: The ENCNet implementation based on PaddlePaddle.
  
  The original article refers to
  Hang Zhang, Kristin Dana, et, al. "Context Encoding for Semantic Segmentation".
  
  Args:
      num_classes (int): The unique number of target classes.
      backbone (Paddle.nn.Layer): A backbone network.
      backbone_indices (tuple): The values in the tuple indicate the indices of
          output of backbone.
      num_codes (int): The number of encoded words. Default: 32.
      mid_channels (int): The channels of middle layers. Default: 512.
      use_se_loss (int): Whether use semantic encoding loss. Default: True.
      add_lateral (int): Whether use lateral convolution layers. Default: False.
      pretrained (str, optional): The path or url of pretrained model. Default: None.
class_docstr_tok: ["The","ENCNet","implementation","based","on","PaddlePaddle",".","The","original","article","refers","to","Hang","Zhang",",","Kristin","Dana",",","et",",","al",".","``","Context","Encoding","for","Semantic","Segmentation","''",".","Args",":","num_classes","(","int",")",":","The","unique","number","of","target","classes",".","backbone","(","Paddle.nn.Layer",")",":","A","backbone","network",".","backbone_indices","(","tuple",")",":","The","values","in","the","tuple","indicate","the","indices","of","output","of","backbone",".","num_codes","(","int",")",":","The","number","of","encoded","words",".","Default",":","32.","mid_channels","(","int",")",":","The","channels","of","middle","layers",".","Default",":","512.","use_se_loss","(","int",")",":","Whether","use","semantic","encoding","loss",".","Default",":","True",".","add_lateral","(","int",")",":","Whether","use","lateral","convolution","layers",".","Default",":","False",".","pretrained","(","str",",","optional",")",":","The","path","or","url","of","pretrained","model",".","Default",":","None","."]
code: def __init__(
      self,
      num_classes,
      backbone,
      backbone_indices=[1, 2, 3],
      num_codes=32,
      mid_channels=512,
      use_se_loss=True,
      add_lateral=False,
      pretrained=None,
  ):
      super().__init__()
      self.add_lateral = add_lateral
      self.num_codes = num_codes
      self.backbone = backbone
      self.backbone_indices = backbone_indices
      in_channels = [
          self.backbone.feat_channels[index]
          for index in backbone_indices
      ]
  
      self.bottleneck = layers.ConvBNReLU(
          in_channels[-1],
          mid_channels,
          3,
          padding=1,
      )
      if self.add_lateral:
          self.lateral_convs = nn.LayerList()
          for in_ch in in_channels[:-1]:
              self.lateral_convs.append(
                  layers.ConvBNReLU(
                      in_ch,
                      mid_channels,
                      1,
                  )
              )
          self.fusion = layers.ConvBNReLU(
              len(in_channels) * mid_channels,
              mid_channels,
              3,
              padding=1,
          )
  
      self.enc_module = EncModule(mid_channels, num_codes)
      self.head = nn.Conv2D(mid_channels, num_classes, 1)
  
      self.fcn_head = layers.AuxLayer(
          self.backbone.feat_channels[2], mid_channels, num_classes
      )
  
      self.use_se_loss = use_se_loss
      if use_se_loss:
          self.se_layer = nn.Linear(mid_channels, num_classes)
  
      self.pretrained = pretrained
      self.init_weight()
  
imports: 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 ENCNet object from inherited base classes: nn with example: obj = ENCNet(num_classes, backbone, backbone_indices, num_codes, mid_channels, use_se_loss, add_lateral, pretrained)