vis4d.op.seg.fcn¶
FCN Head for semantic segmentation.
Classes
|
FCN Head made with ResNet base model. |
|
Output of the FCN prediction. |
- class FCNHead(in_channels, out_channels, dropout_prob=0.1, resize=None)[source]¶
FCN Head made with ResNet base model.
This is based on the implementation in torchvision.
Creates an instance of the class.
- Parameters:
in_channels (list[int]) – Number of channels in multi-level image feature.
out_channels (int) – Number of output channels. Usually the number of classes.
dropout_prob (float, optional) – Dropout probability. Defaults to 0.1.
resize (tuple(int,int), optional) – Target shape to resize output. Defaults to None.
- forward(feats)[source]¶
Transforms feature maps and returns segmentation prediction.
- Parameters:
feats (list[torch.Tensor]) – List of multi-level image features.
- Returns:
Each tensor has shape (batch_size, self.channels, H, W) which is prediction for each FCN stages. E.g.,
outputs[-1] ==> main output map outputs[-2] ==> aux output map (e.g., used for training) outputs[:-2] ==> x[:-2]
- Return type:
output (list[torch.Tensor])