Shortcuts

mmagic.models.archs.vgg

Module Contents

Classes

VGG16

Customized VGG16 Encoder.

class mmagic.models.archs.vgg.VGG16(in_channels: int, batch_norm: Optional[bool] = False, aspp: Optional[bool] = False, dilations: Optional[List[int]] = None, init_cfg: Optional[dict] = None)[source]

Bases: mmengine.model.BaseModule

Customized VGG16 Encoder.

A 1x1 conv is added after the original VGG16 conv layers. The indices of max pooling layers are returned for unpooling layers in decoders.

Parameters
  • in_channels (int) – Number of input channels.

  • batch_norm (bool, optional) – Whether use nn.BatchNorm2d. Default to False.

  • aspp (bool, optional) – Whether use ASPP module after the last conv layer. Default to False.

  • dilations (list[int], optional) – Atrous rates of ASPP module. Default to None.

  • init_cfg (dict, optional) – Initialization config dict.

_make_layer(inplanes: int, planes: int, convs_layers: int) torch.nn.Module[source]
init_weights() None[source]

Init weights for the model.

forward(x: torch.Tensor) Dict[str, torch.Tensor][source]

Forward function for ASPP module.

Parameters

x (Tensor) – Input tensor with shape (N, C, H, W).

Returns

Dict containing output tensor and maxpooling indices.

Return type

dict

Read the Docs v: latest
Versions
latest
stable
0.x
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.