mmagic.models.editors.tof
¶
Package Contents¶
Classes¶
PyTorch implementation of TOFlow for video frame interpolation. |
|
ResNet architecture. |
|
PyTorch implementation of TOFlow. |
- class mmagic.models.editors.tof.TOFlowVFINet(rgb_mean=[0.485, 0.456, 0.406], rgb_std=[0.229, 0.224, 0.225], flow_cfg=dict(norm_cfg=None, pretrained=None), init_cfg=None)[源代码]¶
Bases:
mmengine.model.BaseModule
PyTorch implementation of TOFlow for video frame interpolation.
Paper: Xue et al., Video Enhancement with Task-Oriented Flow, IJCV 2018 Code reference:
- 参数
rgb_mean (list[float]) – Image mean in RGB orders. Default: [0.485, 0.456, 0.406]
rgb_std (list[float]) – Image std in RGB orders. Default: [0.229, 0.224, 0.225]
flow_cfg (dict) – Config of SPyNet. Default: dict(norm_cfg=None, pretrained=None)
init_cfg (dict, optional) – Initialization config dict. Default: None.
- forward(imgs)¶
- 参数
imgs – Input frames with shape of (b, 2, 3, h, w).
- 返回
Interpolated frame with shape of (b, 3, h, w).
- 返回类型
Tensor
- class mmagic.models.editors.tof.ToFResBlock[源代码]¶
Bases:
torch.nn.Module
ResNet architecture.
Three-layers ResNet/ResBlock
- forward(frames)¶
- 参数
frames (Tensor) – Tensor with shape of (b, 2, 3, h, w).
- 返回
Interpolated frame with shape of (b, 3, h, w).
- 返回类型
Tensor
- class mmagic.models.editors.tof.TOFlowVSRNet(adapt_official_weights=False, init_cfg=None)[源代码]¶
Bases:
mmengine.model.BaseModule
PyTorch implementation of TOFlow.
In TOFlow, the LR frames are pre-upsampled and have the same size with the GT frames.
Paper: Xue et al., Video Enhancement with Task-Oriented Flow, IJCV 2018 Code reference:
- 参数
adapt_official_weights (bool) – Whether to adapt the weights translated from the official implementation. Set to false if you want to train from scratch. Default: False
- forward(lrs)¶
- 参数
lrs – Input lr frames: (b, 7, 3, h, w).
- 返回
SR frame: (b, 3, h, w).
- 返回类型
Tensor