class pygmtools.dataset.WillowObject(sets, obj_resize, ds_dict=None, **args)[source]

This class is defined to download and preprocess WillowObject dataset.

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

  • obj_resize – tuple, resized image size

  • ds_dict

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

    TRAIN_NUM: int, number of images for train in each class

    SPLIT_OFFSET: int, offset when split train and test set

    TRAIN_SAME_AS_TEST: bool, whether to use same images for training and test

    RAND_OUTLIER: int, number of added outliers in one image


Automatically download WillowObject dataset.


url – str, web url of WillowObject


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