mmagic.datasets.transforms.aug_frames¶
Module Contents¶
Classes¶
Extend short sequences (e.g. Vimeo-90K) by mirroring the sequences. |
|
Extend short sequences (e.g. Vimeo-90K) by mirroring the sequences. |
|
Reverse frame lists for temporal augmentation. |
- class mmagic.datasets.transforms.aug_frames.RandomMirrorSequence(keys, fix_center=None, mirror_ratio=0.5, shuffle=False)[source]¶
Bases:
mmcv.transforms.BaseTransformExtend short sequences (e.g. Vimeo-90K) by mirroring the sequences.
Given a sequence with N frames (x1, …, xN), extend the sequence to (x1, …, xN, xN, …, x1).
Required Keys:
[KEYS]
Modified Keys:
[KEYS]
- Parameters
keys (list[str]) – The frame lists to be extended.
- CFG:
dict(type=’RandomMirrorSequence’, keys=[‘img’], fix_center=’gt’, mirror_ratio=0.5, shuffle=True)
fix the center frame as gt after shuffle the framelist.
- class mmagic.datasets.transforms.aug_frames.MirrorSequence(keys)[source]¶
Bases:
mmcv.transforms.BaseTransformExtend short sequences (e.g. Vimeo-90K) by mirroring the sequences.
Given a sequence with N frames (x1, …, xN), extend the sequence to (x1, …, xN, xN, …, x1).
Required Keys:
[KEYS]
Modified Keys:
[KEYS]
- Parameters
keys (list[str]) – The frame lists to be extended.
- class mmagic.datasets.transforms.aug_frames.TemporalReverse(keys, reverse_ratio=0.5)[source]¶
Bases:
mmcv.transforms.BaseTransformReverse frame lists for temporal augmentation.
Required keys are the keys in attributes “lq” and “gt”, added or modified keys are “lq”, “gt” and “reverse”.
- Parameters
keys (list[str]) – The frame lists to be reversed.
reverse_ratio (float) – The probability to reverse the frame lists. Default: 0.5.