Shortcuts

mmedit.models.editors.rdn.rdn_net

Module Contents

Classes

RDNNet

RDN model for single image super-resolution.

DenseLayer

Dense layer.

RDB

Residual Dense Block of Residual Dense Network.

class mmedit.models.editors.rdn.rdn_net.RDNNet(in_channels, out_channels, mid_channels=64, num_blocks=16, upscale_factor=4, num_layers=8, channel_growth=64)[源代码]

Bases: mmengine.model.BaseModule

RDN model for single image super-resolution.

Paper: Residual Dense Network for Image Super-Resolution

Adapted from ‘https://github.com/yjn870/RDN-pytorch.git’ ‘RDN-pytorch/blob/master/models.py’ Copyright (c) 2021, JaeYun Yeo, under MIT License.

Most of the implementation follows the implementation in: ‘https://github.com/sanghyun-son/EDSR-PyTorch.git’ ‘EDSR-PyTorch/blob/master/src/model/rdn.py’ Copyright (c) 2017, sanghyun-son, under MIT license.

参数
  • in_channels (int) – Channel number of inputs.

  • out_channels (int) – Channel number of outputs.

  • mid_channels (int) – Channel number of intermediate features. Default: 64.

  • num_blocks (int) – Block number in the trunk network. Default: 16.

  • upscale_factor (int) – Upsampling factor. Support 2^n and 3. Default: 4.

  • num_layer (int) – Layer number in the Residual Dense Block. Default: 8.

  • channel_growth (int) – Channels growth in each layer of RDB. Default: 64.

forward(x)[源代码]

Forward function.

参数

x (Tensor) – Input tensor with shape (n, c, h, w).

返回

Forward results.

返回类型

Tensor

class mmedit.models.editors.rdn.rdn_net.DenseLayer(in_channels, out_channels)[源代码]

Bases: mmengine.model.BaseModule

Dense layer.

参数
  • in_channels (int) – Channel number of inputs.

  • out_channels (int) – Channel number of outputs.

forward(x)[源代码]

Forward function.

参数

x (Tensor) – Input tensor with shape (n, c_in, h, w).

返回

Forward results, tensor with shape (n, c_in+c_out, h, w).

返回类型

Tensor

class mmedit.models.editors.rdn.rdn_net.RDB(in_channels, channel_growth, num_layers)[源代码]

Bases: mmengine.model.BaseModule

Residual Dense Block of Residual Dense Network.

参数
  • in_channels (int) – Channel number of inputs.

  • channel_growth (int) – Channels growth in each layer.

  • num_layers (int) – Layer number in the Residual Dense Block.

forward(x)[源代码]

Forward function.

参数

x (Tensor) – Input tensor with shape (n, c, h, w).

返回

Forward results.

返回类型

Tensor

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.