This is the source code accompanying the paper Dream the Impossible: Outlier Imagination with Diffusion Models by Xuefeng Du, Yiyou Sun, Xiaojin Zhu, and Yixuan Li
The codebase is heavily based on Stable Diffusion.
Check out our latent-based outlier synthesis papers in ICLR'22 VOS and ICLR'23 NPOS if you are interested!
A suitable conda environment named dreamood
can be created
and activated with:
conda env create -f environment.yaml
conda activate dreamood
ImageNet-100
-
Download the full ImageNet dataset from the official website here.
-
Preprocess the dataset to get ImageNet-100 by running:
python scripts/process_in100.py --outdir xxx
where "--outdir" specifies the address of the dataset you want to store.
CIFAR-100
- The dataloader will download it automatically when first running the programs.
OOD datasets
- The OOD datasets with ImageNet-100 as in-distribution are 4 OOD datasets from iNaturalist, SUN, Places, and Textures, which contain the de-duplicated concepts overlapped with ImageNet.
- The OOD datasets with CIFAR-100 as in-distribution are 5 OOD datasets, i.e., SVHN, PLACES365, LSUN, ISUN, TEXTURES.
- Please refer to Part 1 and 2 of the codebase here.