class pygmtools.dataset.SPair71k(sets, obj_resize, problem='2GM', ds_dict=None, **args)[source]

This class is defined to download and preprocess SPair71k dataset.

  • sets – str, problem set, ‘train’ for training set and ‘test’ for test set

  • obj_resize – tuple, resized image size

  • problem – str, problem type, only ‘2GM’ in SPair71k

  • ds_dict

    settings of dataset, containing at most 4 params(keys) for SPair71k:

    TRAIN_DIFF_PARAMS: list of images that should be dumped in train set

    EVAL_DIFF_PARAMS: list of images that should be dumped in test set

    COMB_CLS: bool, whether to combine images in different classes

    SIZE: str, ‘large’ for SPair71k-large and ‘small’ for SPair71k-small


Automatically download SPair71k dataset.


url – str, web url of SPair71k


Process the dataset and generate ‘data.json’ for preprocessed dataset, ‘train.json’ for training set, and ‘test.json’ for test set.