basicsr.archs.ecbsr_arch

class basicsr.archs.ecbsr_arch.ECB(in_channels, out_channels, depth_multiplier, act_type='prelu', with_idt=False)[source]

Bases: Module

The ECB block used in the ECBSR architecture.

Paper: Edge-oriented Convolution Block for Real-time Super Resolution on Mobile Devices Ref git repo: https://github.com/xindongzhang/ECBSR

Parameters:
  • in_channels (int) – Channel number of input.

  • out_channels (int) – Channel number of output.

  • depth_multiplier (int) – Width multiplier in the expand-and-squeeze conv. Default: 1.

  • act_type (str) – Activation type. Option: prelu | relu | rrelu | softplus | linear. Default: prelu.

  • with_idt (bool) – Whether to use identity connection. Default: False.

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

rep_params()[source]
training: bool
class basicsr.archs.ecbsr_arch.ECBSR(num_in_ch, num_out_ch, num_block, num_channel, with_idt, act_type, scale)[source]

Bases: Module

ECBSR architecture.

Paper: Edge-oriented Convolution Block for Real-time Super Resolution on Mobile Devices Ref git repo: https://github.com/xindongzhang/ECBSR

Parameters:
  • num_in_ch (int) – Channel number of inputs.

  • num_out_ch (int) – Channel number of outputs.

  • num_block (int) – Block number in the trunk network.

  • num_channel (int) – Channel number.

  • with_idt (bool) – Whether use identity in convolution layers.

  • act_type (str) – Activation type.

  • scale (int) – Upsampling factor.

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool
class basicsr.archs.ecbsr_arch.SeqConv3x3(seq_type, in_channels, out_channels, depth_multiplier=1)[source]

Bases: Module

The re-parameterizable block used in the ECBSR architecture.

Paper: Edge-oriented Convolution Block for Real-time Super Resolution on Mobile Devices

Reference: https://github.com/xindongzhang/ECBSR

Parameters:
  • seq_type (str) – Sequence type, option: conv1x1-conv3x3 | conv1x1-sobelx | conv1x1-sobely | conv1x1-laplacian.

  • in_channels (int) – Channel number of input.

  • out_channels (int) – Channel number of output.

  • depth_multiplier (int) – Width multiplier in the expand-and-squeeze conv. Default: 1.

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

rep_params()[source]
training: bool