class_docstr: [Real Time] The FC-HardDNet 70 implementation based on PaddlePaddle.
  The original article refers to
      Chao, Ping, et al. "HarDNet: A Low Memory Traffic Network"
      (https://arxiv.org/pdf/1909.00948.pdf)
  
  Args:
      num_classes (int): The unique number of target classes.
      stem_channels (tuple|list, optional): The number of channels before the encoder. Default: (16, 24, 32, 48).
      ch_list (tuple|list, optional): The number of channels at each block in the encoder. Default: (64, 96, 160, 224, 320).
      grmul (float, optional): The channel multiplying factor in HarDBlock, which is m in the paper. Default: 1.7.
      gr (tuple|list, optional): The growth rate in each HarDBlock, which is k in the paper. Default: (10, 16, 18, 24, 32).
      n_layers (tuple|list, optional): The number of layers in each HarDBlock. Default: (4, 4, 8, 8, 8).
      align_corners (bool): An argument of F.interpolate. It should be set to False when the output size of feature
          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: ["[","Real","Time","]","The","FC-HardDNet","70","implementation","based","on","PaddlePaddle",".","The","original","article","refers","to","Chao",",","Ping",",","et","al",".","``","HarDNet",":","A","Low","Memory","Traffic","Network","''","(","https",":","\/\/arxiv.org\/pdf\/1909.00948.pdf",")","Args",":","num_classes","(","int",")",":","The","unique","number","of","target","classes",".","stem_channels","(","tuple|list",",","optional",")",":","The","number","of","channels","before","the","encoder",".","Default",":","(","16",",","24",",","32",",","48",")",".","ch_list","(","tuple|list",",","optional",")",":","The","number","of","channels","at","each","block","in","the","encoder",".","Default",":","(","64",",","96",",","160",",","224",",","320",")",".","grmul","(","float",",","optional",")",":","The","channel","multiplying","factor","in","HarDBlock",",","which","is","m","in","the","paper",".","Default",":","1.7.","gr","(","tuple|list",",","optional",")",":","The","growth","rate","in","each","HarDBlock",",","which","is","k","in","the","paper",".","Default",":","(","10",",","16",",","18",",","24",",","32",")",".","n_layers","(","tuple|list",",","optional",")",":","The","number","of","layers","in","each","HarDBlock",".","Default",":","(","4",",","4",",","8",",","8",",","8",")",".","align_corners","(","bool",")",":","An","argument","of","F.interpolate",".","It","should","be","set","to","False","when","the","output","size","of","feature","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,
      stem_channels: Tuple[int] = (16, 24, 32, 48),
      ch_list: Tuple[int] = (64, 96, 160, 224, 320),
      grmul: float = 1.7,
      gr: Tuple[int] = (10, 16, 18, 24, 32),
      n_layers: Tuple[int] = (4, 4, 8, 8, 8),
      align_corners: bool = False,
      pretrained: str = None,
  ):
      super(HarDNet, self).__init__()
      self.align_corners = align_corners
      self.pretrained = pretrained
      encoder_blks_num = len(n_layers)
      decoder_blks_num = encoder_blks_num - 1
      encoder_in_channels = stem_channels[3]
  
      self.stem = nn.Sequential(
          layers.ConvBNReLU(
              3, stem_channels[0], kernel_size=3, bias_attr=False
          ),
          layers.ConvBNReLU(
              stem_channels[0],
              stem_channels[1],
              kernel_size=3,
              bias_attr=False,
          ),
          layers.ConvBNReLU(
              stem_channels[1],
              stem_channels[2],
              kernel_size=3,
              stride=2,
              bias_attr=False,
          ),
          layers.ConvBNReLU(
              stem_channels[2],
              stem_channels[3],
              kernel_size=3,
              bias_attr=False,
          ),
      )
  
      self.encoder = Encoder(
          encoder_blks_num,
          encoder_in_channels,
          ch_list,
          gr,
          grmul,
          n_layers,
      )
  
      skip_connection_channels = self.encoder.get_skip_channels()
      decoder_in_channels = self.encoder.get_out_channels()
  
      self.decoder = Decoder(
          decoder_blks_num,
          decoder_in_channels,
          skip_connection_channels,
          gr,
          grmul,
          n_layers,
          align_corners,
      )
  
      self.cls_head = nn.Conv2D(
          in_channels=self.decoder.get_out_channels(),
          out_channels=num_classes,
          kernel_size=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, Tuple, List
  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 hardnet_cityscapes.layers
label_desc: Use image node_id 1 to create a new HarDNet object from inherited base classes: nn with example: obj = HarDNet(num_classes, stem_channels, ch_list, grmul, gr, n_layers, align_corners, pretrained)