Shortcuts

mmagic.models.editors.plain

Package Contents

Classes

PlainDecoder

Simple decoder from Deep Image Matting.

PlainRefiner

Simple refiner from Deep Image Matting.

class mmagic.models.editors.plain.PlainDecoder(in_channels, init_cfg: Optional[dict] = None)[源代码]

Bases: mmengine.model.BaseModule

Simple decoder from Deep Image Matting.

参数
  • in_channels (int) – Channel num of input features.

  • init_cfg (dict, optional) – Initialization config dict. Default: None.

init_weights()

Init weights for the module.

forward(inputs)

Forward function of PlainDecoder.

参数

inputs (dict) –

Output dictionary of the VGG encoder containing:

  • out (Tensor): Output of the VGG encoder.

  • max_idx_1 (Tensor): Index of the first maxpooling layer in the VGG encoder.

  • max_idx_2 (Tensor): Index of the second maxpooling layer in the VGG encoder.

  • max_idx_3 (Tensor): Index of the third maxpooling layer in the VGG encoder.

  • max_idx_4 (Tensor): Index of the fourth maxpooling layer in the VGG encoder.

  • max_idx_5 (Tensor): Index of the fifth maxpooling layer in the VGG encoder.

返回

Output tensor.

返回类型

Tensor

class mmagic.models.editors.plain.PlainRefiner(conv_channels=64, init_cfg=None)[源代码]

Bases: mmengine.model.BaseModule

Simple refiner from Deep Image Matting.

参数
  • conv_channels (int) – Number of channels produced by the three main convolutional layer. Default: 64.

  • pretrained (str) – Name of pretrained model. Default: None.

init_weights()

Init weights for the module.

forward(x, raw_alpha)

Forward function.

参数
  • x (Tensor) – The input feature map of refiner.

  • raw_alpha (Tensor) – The raw predicted alpha matte.

返回

The refined alpha matte.

返回类型

Tensor

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.