Shortcuts

UnpairedImageDataset

class mmedit.datasets.UnpairedImageDataset(data_root, pipeline, io_backend: Optional[str] = None, test_mode=False, domain_a='A', domain_b='B')[source]

General unpaired image folder dataset for image generation.

It assumes that the training directory of images from domain A is ‘/path/to/data/trainA’, and that from domain B is ‘/path/to/data/trainB’, respectively. ‘/path/to/data’ can be initialized by args ‘dataroot’. During test time, the directory is ‘/path/to/data/testA’ and ‘/path/to/data/testB’, respectively.

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

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

  • io_backend (str, optional) – The storage backend type. Options are “disk”, “ceph”, “memcached”, “lmdb”, “http” and “petrel”. Default: None.

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

  • domain_a (str, optional) – Domain of images in trainA / testA. Defaults to ‘A’.

  • domain_b (str, optional) – Domain of images in trainB / testB. Defaults to ‘B’.

get_data_info(idx) dict[source]

Get annotation by index and automatically call full_init if the dataset has not been fully initialized.

Parameters

idx (int) – The index of data.

Returns

The idx-th annotation of the dataset.

Return type

dict

load_data_list()[source]

Load the data list.

Returns

The data info list of source and target domain.

Return type

list

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: zyh/doc-notfound-extend
Versions
master
latest
stable
zyh-doc-notfound-extend
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.