PSPNet

class mmit.decoders.PSPNet(input_channels, input_reductions, decoder_channel=256, dropout=0.2, sizes=(1, 2, 3, 6), feature_index=None, upsample_layer=<class 'mmit.base.upsamplers.Upsample'>, norm_layer=<class 'torch.nn.modules.batchnorm.BatchNorm2d'>, activation_layer=<class 'torch.nn.modules.activation.ReLU'>, extra_layer=<class 'torch.nn.modules.linear.Identity'>)

Implementation of the PSPNet decoder. Paper: https://arxiv.org/abs/1612.01105. To follow the paper as much as possible, we only process the feature map closest to the stride 8 by default.

Parameters:
  • input_channels (List[int]) – The channels of the input features.

  • input_reductions (List[int]) – The reduction factor of the input features.

  • decoder_channel (int) – The channel to use on the decoder.

  • dropout (float) – The dropout to use.

  • sizes (List[int]) – The sizes to use on the PSP module.

  • feature_index (Optional[int]) – The index of the feature to use.

  • upsample_layer (Type[Module]) – Upsampling layer to use.

  • norm_layer (Type[Module]) – Normalization layer to use.

  • activation_layer (Type[Module]) – Activation function to use.

  • extra_layer (Type[Module]) – Addional layer to use.

forward(*features)

Forward pass of the decoder.

Parameters:

*features (Tensor) – Features from the encoder, the first is the input image, last one the deepest.

property out_classes: int

Number of output classes.