Shortcuts

mmagic.models.editors.fba.fba_decoder

Module Contents

Classes

FBADecoder

Decoder for FBA matting.

class mmagic.models.editors.fba.fba_decoder.FBADecoder(pool_scales, in_channels, channels, conv_cfg=None, norm_cfg=dict(type='BN'), act_cfg=dict(type='ReLU'), align_corners=False)[source]

Bases: torch.nn.Module

Decoder for FBA matting.

Parameters
  • pool_scales (tuple[int]) – Pooling scales used in

  • Module. (Pooling Pyramid) –

  • in_channels (int) – Input channels.

  • channels (int) – Channels after modules, before conv_seg.

  • conv_cfg (dict|None) – Config of conv layers.

  • norm_cfg (dict|None) – Config of norm layers.

  • act_cfg (dict) – Config of activation layers.

  • align_corners (bool) – align_corners argument of F.interpolate.

init_weights(pretrained=None)[source]

Init weights for the model.

Parameters

pretrained (str, optional) – Path for pretrained weights. If given None, pretrained weights will not be loaded. Defaults to None.

forward(inputs)[source]

Forward function.

Parameters

inputs (dict) – Output dict of FbaEncoder.

Returns

Predicted alpha, fg and bg of the current batch.

Return type

tuple(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.