class_docstr: DeepLab v3
class_docstr_tok: ["DeepLab","v3"]
code: def __init__(
      self, n_classes, n_blocks, pyramids, grids, output_stride
  ):
      super(DeepLabV3, self).__init__()
  
      if output_stride == 8:
          stride = [1, 2, 1, 1]
          dilation = [1, 1, 2, 2]
      elif output_stride == 16:
          stride = [1, 2, 2, 1]
          dilation = [1, 1, 1, 2]
  
      self.add_module(
          "layer1",
          nn.Sequential(
              OrderedDict(
                  [
                      ("conv1", _ConvBatchNormReLU(3, 64, 7, 2, 3, 1)),
                      ("pool", nn.MaxPool2d(3, 2, 1, ceil_mode=True)),
                  ]
              )
          ),
      )
      self.add_module(
          "layer2",
          _ResBlock(n_blocks[0], 64, 64, 256, stride[0], dilation[0]),
      )
      self.add_module(
          "layer3",
          _ResBlock(n_blocks[1], 256, 128, 512, stride[1], dilation[1]),
      )
      self.add_module(
          "layer4",
          _ResBlock(
              n_blocks[2], 512, 256, 1024, stride[2], dilation[2]
          ),
      )
      self.add_module(
          "layer5",
          _ResBlock(
              n_blocks[3],
              1024,
              512,
              2048,
              stride[3],
              dilation[3],
              mg=grids,
          ),
      )
      self.add_module("aspp", _ASPPModule(2048, 256, pyramids))
      self.add_module(
          "fc1",
          _ConvBatchNormReLU(
              256 * (len(pyramids) + 2), 256, 1, 1, 0, 1
          ),
      )
      self.add_module("fc2", nn.Conv2d(256, n_classes, kernel_size=1))
  
file_path: pywick/pywick/models/segmentation/testnets/deeplabv3.py
imports: from collections import OrderedDict
  import torch
  import torch.nn
  import torch.nn.functional
  from .resnet import _ConvBatchNormReLU, _ResBlock
  from .msc import MSC
label_desc: Use image node_id 1 to create a new DeepLabV3 object from inherited base classes: nn with example: obj = DeepLabV3(n_classes, n_blocks, pyramids, grids, output_stride)