mmagic.models.editors.liif
¶
Package Contents¶
Classes¶
LIIF model for single image super-resolution. |
|
LIIF net based on EDSR. |
|
LIIF net based on RDN. |
|
Multilayer perceptrons (MLPs), refiner used in LIIF. |
- class mmagic.models.editors.liif.LIIF(generator: dict, pixel_loss: dict, train_cfg: Optional[dict] = None, test_cfg: Optional[dict] = None, init_cfg: Optional[dict] = None, data_preprocessor: Optional[dict] = None)[source]¶
Bases:
mmagic.models.base_models.BaseEditModel
LIIF model for single image super-resolution.
- Paper: Learning Continuous Image Representation with
Local Implicit Image Function
- Parameters
generator (dict) – Config for the generator.
pixel_loss (dict) – Config for the pixel loss.
pretrained (str) – Path for pretrained model. Default: None.
data_preprocessor (dict, optional) – The pre-process config of
BaseDataPreprocessor
.
- forward_tensor(inputs, data_samples=None, **kwargs)[source]¶
Forward tensor. Returns result of simple forward.
- Parameters
inputs (torch.Tensor) – batch input tensor collated by
data_preprocessor
.data_samples (List[BaseDataElement], optional) – data samples collated by
data_preprocessor
.
- Returns
result of simple forward.
- Return type
Tensor
- forward_inference(inputs, data_samples=None, **kwargs)[source]¶
Forward inference. Returns predictions of validation, testing, and simple inference.
- Parameters
inputs (torch.Tensor) – batch input tensor collated by
data_preprocessor
.data_samples (BaseDataElement, optional) – data samples collated by
data_preprocessor
.
- Returns
predictions.
- Return type
List[DataSample]
- class mmagic.models.editors.liif.LIIFEDSRNet(encoder, imnet, local_ensemble=True, feat_unfold=True, cell_decode=True, eval_bsize=None)[source]¶
Bases:
LIIFNet
LIIF net based on EDSR.
- Paper: Learning Continuous Image Representation with
Local Implicit Image Function
- Parameters
encoder (dict) – Config for the generator.
imnet (dict) – Config for the imnet.
local_ensemble (bool) – Whether to use local ensemble. Default: True.
feat_unfold (bool) – Whether to use feature unfold. Default: True.
cell_decode (bool) – Whether to use cell decode. Default: True.
eval_bsize (int) – Size of batched predict. Default: None.
- class mmagic.models.editors.liif.LIIFRDNNet(encoder, imnet, local_ensemble=True, feat_unfold=True, cell_decode=True, eval_bsize=None)[source]¶
Bases:
LIIFNet
LIIF net based on RDN.
- Paper: Learning Continuous Image Representation with
Local Implicit Image Function
- Parameters
encoder (dict) – Config for the generator.
imnet (dict) – Config for the imnet.
local_ensemble (bool) – Whether to use local ensemble. Default: True.
feat_unfold (bool) – Whether to use feat unfold. Default: True.
cell_decode (bool) – Whether to use cell decode. Default: True.
eval_bsize (int) – Size of batched predict. Default: None.