Shortcuts

mmedit.models.base_archs.vgg

Module Contents

Classes

VGG16

Customized VGG16 Encoder.

class mmedit.models.base_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)[源代码]

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.

参数
  • 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[源代码]
init_weights() None[源代码]

Init weights for the model.

forward(x: torch.Tensor) Dict[str, torch.Tensor][源代码]

Forward function for ASPP module.

参数

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

返回

Dict containing output tensor and maxpooling indices.

返回类型

dict

Read the Docs v: latest
Versions
master
latest
stable
zyh-doc-notfound-extend
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.