mmagic.datasets.unpaired_image_dataset
¶
Module Contents¶
Classes¶
General unpaired image folder dataset for image generation. |
Attributes¶
- mmagic.datasets.unpaired_image_dataset.IMG_EXTENSIONS = ('.jpg', '.JPG', '.jpeg', '.JPEG', '.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP', '.tif',...[source]¶
- class mmagic.datasets.unpaired_image_dataset.UnpairedImageDataset(data_root, pipeline, io_backend: Optional[str] = None, test_mode=False, domain_a='A', domain_b='B')[source]¶
Bases:
mmengine.dataset.BaseDataset
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’.
- load_data_list()[source]¶
Load the data list.
- Returns
The data info list of source and target domain.
- Return type
list
- _load_domain_data_list(dataroot)[source]¶
Load unpaired image paths of one domain.
- Parameters
dataroot (str) – Path to the folder root for unpaired images of one domain.
- Returns
List that contains unpaired image paths of one domain.
- Return type
list[dict]