Shortcuts

mmagic.models.editors.plain.plain_refiner

Module Contents

Classes

PlainRefiner

Simple refiner from Deep Image Matting.

class mmagic.models.editors.plain.plain_refiner.PlainRefiner(conv_channels=64, init_cfg=None)[source]

Bases: mmengine.model.BaseModule

Simple refiner from Deep Image Matting.

Parameters
  • 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()[source]

Init weights for the module.

forward(x, raw_alpha)[source]

Forward function.

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

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

Returns

The refined alpha matte.

Return type

Tensor