class_docstr: The FastSCNN implementation based on PaddlePaddle.
  As mentioned in the original paper, FastSCNN is a real-time segmentation algorithm (123.5fps)
  even for high resolution images (1024x2048).
  The original article refers to
  Poudel, Rudra PK, et al. "Fast-scnn: Fast semantic segmentation network"
  (https://arxiv.org/pdf/1902.04502.pdf).
  Args:
      num_classes (int): The unique number of target classes, default is 19.
      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: ["The","FastSCNN","implementation","based","on","PaddlePaddle",".","As","mentioned","in","the","original","paper",",","FastSCNN","is","a","real-time","segmentation","algorithm","(","123.5fps",")","even","for","high","resolution","images","(","1024x2048",")",".","The","original","article","refers","to","Poudel",",","Rudra","PK",",","et","al",".","``","Fast-scnn",":","Fast","semantic","segmentation","network","''","(","https",":","\/\/arxiv.org\/pdf\/1902.04502.pdf",")",".","Args",":","num_classes","(","int",")",":","The","unique","number","of","target","classes",",","default","is","19.","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,
      align_corners: bool = False,
      pretrained: str = None,
  ):
      super(FastSCNN, self).__init__()
  
      self.learning_to_downsample = LearningToDownsample(32, 48, 64)
      self.global_feature_extractor = GlobalFeatureExtractor(
          in_channels=64,
          block_channels=[64, 96, 128],
          out_channels=128,
          expansion=6,
          num_blocks=[3, 3, 3],
          align_corners=True,
      )
      self.feature_fusion = FeatureFusionModule(
          64, 128, 128, align_corners
      )
      self.classifier = Classifier(128, 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, "fastscnn_model.pdparams"
          )
          model_dict = paddle.load(checkpoint)
          self.set_dict(model_dict)
          print("load pretrained parameters success")
  
imports: import os
  from typing import Callable, Union, Tuple
  import paddle.nn
  import paddle.nn.functional
  import paddle
  import numpy
  from paddlehub.module.module import moduleinfo
  import paddlehub.vision.segmentation_transforms
  from paddlehub.module.cv_module import ImageSegmentationModule
  import fastscnn_cityscapes.layers
label_desc: Use image node_id 1 to create a new FastSCNN object from inherited base classes: nn with example: obj = FastSCNN(num_classes, align_corners, pretrained)