SPair71k

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

Download and preprocess SPair71k dataset.

Parameters
  • sets – str, problem set, 'train' for training set and 'test' for testing set

  • obj_resize – tuple, resized image size

  • problem – str, problem type, only '2GM' is supported in SPair71k

  • ds_dict

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

    • ROOT_DIR: str, directory of data

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

    • EVAL_DIFF_PARAMS: list of images that should be dumped in testing set

    • COMB_CLS: bool, whether to combine images in different classes

    • SIZE: str, 'large' for SPair71k-large and 'small' for SPair71k-small

download(url=None, retries=5)[source]

Automatically download SPair71k dataset.

Parameters

url – str, web url of SPair71k

process()[source]

Process the dataset and generate data-(size, size).json for preprocessed dataset, train.json for training set, and test.json for testing set.