Shortcuts

mmagic.datasets.paired_image_dataset

Module Contents

Classes

PairedImageDataset

General paired image folder dataset for image generation.

Attributes

IMG_EXTENSIONS

mmagic.datasets.paired_image_dataset.IMG_EXTENSIONS = ('.jpg', '.JPG', '.jpeg', '.JPEG', '.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP', '.tif',...[source]
class mmagic.datasets.paired_image_dataset.PairedImageDataset(data_root, pipeline, io_backend: Optional[str] = None, test_mode=False, test_dir='test')[source]

Bases: mmengine.dataset.BaseDataset

General paired image folder dataset for image generation.

It assumes that the training directory is ‘/path/to/data/train’. During test time, the directory is ‘/path/to/data/test’. ‘/path/to/data’ can be initialized by args ‘dataroot’. Each sample contains a pair of images concatenated in the w dimension (A|B).

Parameters
  • dataroot (str | Path) – Path to the folder root of paired images.

  • pipeline (List[dict | callable]) – A sequence of data transformations.

  • test_mode (bool) – Store True when building test dataset. Default: False.

  • test_dir (str) – Subfolder of dataroot which contain test images. Default: ‘test’.

load_data_list()[source]

Load paired image paths.

Returns

List that contains paired image paths.

Return type

list[dict]

scan_folder(path)[source]

Obtain image path list (including sub-folders) from a given folder.

Parameters

path (str | Path) – Folder path.

Returns

Image list obtained from the given folder.

Return type

list[str]

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.