Augmentations

DD-Ranking supports commonly used data augmentations in existing methods. A list of augmentations is provided below:

In DD-Ranking, data augmentations are specified when initializing an evaluator. The following arguments are related to data augmentations:

  • data_aug_func(str): The name of the data augmentation function used during training. Currently, we support dsa, mixup, cutmix.
  • aug_params(dict): The parameters for the data augmentation function.
  • custom_train_trans(torchvision.transforms.Compose): The custom train transform used to load the synthetic data when it's in '.jpg' or '.png' format.
  • custom_val_trans(torchvision.transforms.Compose): The custom val transform used to load the test dataset.
  • use_zca(bool): Whether to use ZCA whitening for the data augmentation. This is only applicable to methods that use ZCA whitening during distillation.
# When initializing an evaluator, the data augmentation function is specified.
>>> evaluator = SoftLabelEvaluator(
    ...
    data_aug_func=..., # Specify the data augmentation function
    aug_params=..., # Specify the parameters for the data augmentation function
    custom_train_trans=..., # Specify the custom train transform
    custom_val_trans=..., # Specify the custom val transform
    use_zca=..., # Specify whether to use ZCA whitening
    ...
)