Shortcuts

mmagic.datasets.transforms.generate_frame_indices

Module Contents

Classes

GenerateFrameIndices

Generate frame index for REDS datasets. It also performs temporal

GenerateFrameIndiceswithPadding

Generate frame index with padding for REDS dataset and Vid4 dataset

GenerateSegmentIndices

Generate frame indices for a segment. It also performs temporal

class mmagic.datasets.transforms.generate_frame_indices.GenerateFrameIndices(interval_list, frames_per_clip=99)[source]

Bases: mmcv.transforms.BaseTransform

Generate frame index for REDS datasets. It also performs temporal augmentation with random interval.

Required Keys:

  • img_path

  • gt_path

  • key

  • num_input_frames

Modified Keys:

  • img_path

  • gt_path

Added Keys:

  • interval

  • reverse

Parameters
  • interval_list (list[int]) – Interval list for temporal augmentation. It will randomly pick an interval from interval_list and sample frame index with the interval.

  • frames_per_clip (int) – Number of frames per clips. Default: 99 for REDS dataset.

transform(results)[source]

transform function.

Parameters

results (dict) – A dict containing the necessary information and data for augmentation.

Returns

A dict containing the processed data and information.

Return type

dict

__repr__()[source]

Return repr(self).

class mmagic.datasets.transforms.generate_frame_indices.GenerateFrameIndiceswithPadding(padding, filename_tmpl='{:08d}')[source]

Bases: mmcv.transforms.BaseTransform

Generate frame index with padding for REDS dataset and Vid4 dataset during testing.

Required Keys:

  • img_path

  • gt_path

  • key

  • num_input_frames

  • sequence_length

Modified Keys:

  • img_path

  • gt_path

Parameters

padding

padding mode, one of ‘replicate’ | ‘reflection’ | ‘reflection_circle’ | ‘circle’.

Examples: current_idx = 0, num_input_frames = 5 The generated frame indices under different padding mode:

replicate: [0, 0, 0, 1, 2] reflection: [2, 1, 0, 1, 2] reflection_circle: [4, 3, 0, 1, 2] circle: [3, 4, 0, 1, 2]

transform(results)[source]

transform function.

Parameters

results (dict) – A dict containing the necessary information and data for augmentation.

Returns

A dict containing the processed data and information.

Return type

dict

__repr__()[source]

Return repr(self).

class mmagic.datasets.transforms.generate_frame_indices.GenerateSegmentIndices(interval_list, start_idx=0, filename_tmpl='{:08d}.png')[source]

Bases: mmcv.transforms.BaseTransform

Generate frame indices for a segment. It also performs temporal augmentation with random interval.

Required Keys:

  • img_path

  • gt_path

  • key

  • num_input_frames

  • sequence_length

Modified Keys:

  • img_path

  • gt_path

Added Keys:

  • interval

  • reverse

Parameters
  • interval_list (list[int]) – Interval list for temporal augmentation. It will randomly pick an interval from interval_list and sample frame index with the interval.

  • start_idx (int) – The index corresponds to the first frame in the sequence. Default: 0.

  • filename_tmpl (str) – Template for file name. Default: ‘{:08d}.png’.

transform(results)[source]

transform function.

Parameters

results (dict) – A dict containing the necessary information and data for augmentation.

Returns

A dict containing the processed data and information.

Return type

dict

__repr__()[source]

Return repr(self).

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.