This codebase is tested on Ubuntu 20.04.2 LTS with python 3.10. Follow the below steps to create environment and install dependencies.
- Create the environment
conda create env -n distdiff python=3.10.6 -y
conda activate distdiff
- Install necessary python libraries:
pip install numpy scipy matplotlib scikit-image medmnist timm regex tqdm accelerate transformers==4.19.2
- Install CLIP:
pip install open_clip_torch
- Install diffuser:
git clone https://github.com/huggingface/diffusers
cd diffusers
pip install -e .
- Install CutMix (optional)
pip install git+https://github.com/ildoonet/cutmix
The instructions to prepare each dataset are detailed below.
All the datasets should be prepared in ./data/
.
Datasets list:
- Download datasets:
Please download the dataset at https://drive.google.com/file/d/12Aryi3Dan8hXrw0_Kg2WU_4BIEwY4csT/view?usp=drive_link
unzip CIFAR_10000.zip
mv CIFAR_10000 data
- Download datasets:
Please download the Caltech101 dataset at https://www.kaggle.com/datasets/imbikramsaha/caltech-101
Please unzip it and name it as caltech-101
mv caltech-101 data
- Download datasets:
Please download the dataset at https://www.kaggle.com/datasets/jessicali9530/stanford-cars-dataset
Please unzip it and name it as stanford_cars
mv stanford_cars data
- Download datasets:
Please download the dataset at https://www.robots.ox.ac.uk/~vgg/data/dtd
Please unzip it and name it as dtd
mv dtd data
- Download datasets:
Please download the dataset at https://www.robots.ox.ac.uk/~vgg/data/flowers/102
Please unzip it and name it as oxford_flowers
mv oxford_flowers data
- Download datasets:
Please download the dataset at https://www.robots.ox.ac.uk/~vgg/data/pets
Please unzip it and name it as oxford_pets
mv oxford_pets data