PyTorch implementation of DeMix | paper link
pip install -r requirements.txt
download the fine-grained datasets:
Stanford-Cars devkit, train, test, test_annos_withlabels
1, import the function:from datasets.dataset_process import compute_detr_res
2, run the function: compute_detr_res(dataset_name='cub', datadir='cub data dir') # ['cub', 'car', 'aircraft']
python demix.py
--dataset='cub' # ['cub', 'car', 'aircraft']
--netname='resnet18' # ['resnet18', 'resnet34', 'resnet50', 'resnet101', 'inception_v3', 'densenet121']
--mixmethod='detrmix' # ['detrmix', 'saliencymix', 'mixup', 'cutmix']
--pretrained=1 # if training from scratch, set pretrained=0
If you find this code useful, please kindly cite
@article{wang2023use,
title={Use the Detection Transformer as a Data Augmenter},
author={Wang, Luping and Liu, Bin},
journal={arXiv preprint arXiv:2304.04554},
year={2023}
}
This code is based on the SnapMix.
If you have any questions or suggestions, please feel free to contact wangluping/[email protected].