Shortcuts

mmedit.models.editors.tdan.tdan_net

Module Contents

Classes

TDANNet

TDAN network structure for video super-resolution.

AugmentedDeformConv2dPack

Augmented Deformable Convolution Pack.

class mmedit.models.editors.tdan.tdan_net.TDANNet(in_channels=3, mid_channels=64, out_channels=3, num_blocks_before_align=5, num_blocks_after_align=10)[源代码]

Bases: mmengine.model.BaseModule

TDAN network structure for video super-resolution.

Support only x4 upsampling.

Paper:

TDAN: Temporally-Deformable Alignment Network for Video Super- Resolution, CVPR, 2020

参数
  • in_channels (int) – Number of channels of the input image. Default: 3.

  • mid_channels (int) – Number of channels of the intermediate features. Default: 64.

  • out_channels (int) – Number of channels of the output image. Default: 3.

  • num_blocks_before_align (int) – Number of residual blocks before temporal alignment. Default: 5.

  • num_blocks_after_align (int) – Number of residual blocks after temporal alignment. Default: 10.

forward(lrs)[源代码]

Forward function for TDANNet.

参数

lrs (Tensor) – Input LR sequence with shape (n, t, c, h, w).

返回

Output HR image with shape (n, c, 4h, 4w) and aligned LR images with shape (n, t, c, h, w).

返回类型

tuple[Tensor]

class mmedit.models.editors.tdan.tdan_net.AugmentedDeformConv2dPack(*args, **kwargs)[源代码]

Bases: mmcv.ops.DeformConv2d

Augmented Deformable Convolution Pack.

Different from DeformConv2dPack, which generates offsets from the preceding feature, this AugmentedDeformConv2dPack takes another feature to generate the offsets.

参数
  • in_channels (int) – Number of channels in the input feature.

  • out_channels (int) – Number of channels produced by the convolution.

  • kernel_size (int or tuple[int]) – Size of the convolving kernel.

  • stride (int or tuple[int]) – Stride of the convolution. Default: 1.

  • padding (int or tuple[int]) – Zero-padding added to both sides of the input. Default: 0.

  • dilation (int or tuple[int]) – Spacing between kernel elements. Default: 1.

  • groups (int) – Number of blocked connections from input channels to output channels. Default: 1.

  • deform_groups (int) – Number of deformable group partitions.

  • bias (bool or str) – If specified as auto, it will be decided by the norm_cfg. Bias will be set as True if norm_cfg is None, otherwise False.

init_offset()[源代码]

Init constant offset.

forward(x, extra_feat)[源代码]

Forward function.

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.