code: def __init__(self, num_classes, pretrained=True, **kwargs):
      super(PSPNet, self).__init__()
  
      feats = list(models.resnet101(pretrained=pretrained).modules())
      resent = models.resnet101(pretrained=pretrained)
  
      self.layer0 = nn.Sequential(
          resent.conv1, resent.bn1, resent.relu, resent.maxpool
      )
      self.layer1 = resent.layer1
      self.layer2 = resent.layer2
      self.layer3 = resent.layer3
      self.layer4 = resent.layer4
  
      for n, m in self.layer3.named_modules():
          if "conv2" in n:
              m.dilation = (2, 2)
              m.padding = (2, 2)
              m.stride = (1, 1)
          if "downsample.0" in n:
              m.stride = (1, 1)
  
      for n, m in self.layer4.named_modules():
          if "conv2" in n:
              m.dilation = (4, 4)
              m.padding = (4, 4)
              m.stride = (1, 1)
          if "downsample.0" in n:
              m.stride = (1, 1)
  
      # NOte that the size of input image is assumed to be 240hx320w
      self.ppm = PyramidPoolingModule(
          in_size=(30, 40),
          in_channels=2048,
          out_channels=512,
          setting=(1, 2, 3, 6),
      )
  
      # 4x512 = 4096
      self.final = nn.Sequential(
          nn.Conv2d(4096, 512, kernel_size=1, stride=1, bias=False),
          nn.BatchNorm2d(512),
          nn.ReLU(inplace=True),
          nn.Conv2d(512, num_classes, kernel_size=1),
      )
  
      self.activation = nn.Sigmoid()
      initialize_weights(self.ppm, self.final)
  
file_path: pywick/pywick/models/segmentation/testnets/psp_saeed.py
imports: import torch
  import torch.nn.init
  import torch.nn
  from torchvision import models
  import torch.nn.functional
  import numpy
  import math
label_desc: Use image node_id 1 to create a new PSPNet object from inherited base classes: nn with example: obj = PSPNet(num_classes, pretrained)