Shortcuts

mmagic.models.editors.ttsr.lte

Module Contents

Classes

LTE

Learnable Texture Extractor.

class mmagic.models.editors.ttsr.lte.LTE(requires_grad=True, pixel_range=1.0, load_pretrained_vgg=True, init_cfg=None)[source]

Bases: mmengine.model.BaseModule

Learnable Texture Extractor.

Based on pretrained VGG19. Generate features in 3 levels.

Parameters
  • requires_grad (bool) – Require grad or not. Default: True.

  • pixel_range (float) – Pixel range of feature. Default: 1.

  • load_pretrained_vgg (bool) – Load pretrained VGG from torchvision. Default: True. Train: must load pretrained VGG. Eval: needn’t load pretrained VGG, because we will load pretrained LTE.

  • init_cfg (dict, optional) – Initialization config dict.

forward(x)[source]

Forward function.

Parameters

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

Returns

Forward results in 3 levels.

x_level3: Forward results in level 3 (n, 256, h/4, w/4). x_level2: Forward results in level 2 (n, 128, h/2, w/2). x_level1: Forward results in level 1 (n, 64, h, w).

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.