Skip to content

Maryeon/InvMM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InvMM

Official PyTorch implementation of Inversion-based Measure of Memorization.

teaser

This repository follows the implemetations of codebases pytorch-ddpm, latent-diffusion, stable-diffusion-v1 and stable-diffusion-v2. We also modify some source codes, including introducing xformers support for stable-diffusion-v1 and fixing bugs in DDIM sampler.

Requirements

Go to the specific directory and create an anaconda environment with:

cd ddpm[latent-diffusion, stable-diffusion-v1, stable-diffusion-v2]
conda env create -f environment.yaml

Change Torch and xformers to appropriate versions depending on your own CUDA run time library.

Data Preparation

CIFAR-10

CIFAR-10 can be downloaded on the official website. Obtain the IDs of 99 highly memorized images and 1000 normal images if needed.

Faces

We use the CelebAHQ-256 dataset on Kaggle and FFHQ following their official repository.

LAION

The subsets of LAION used in the paper can be downloaded here.

Pretrained Distribution Parameters

Model Dataset Link
DDPM CIFAR-10 https://drive.google.com/file/d/1TJDmFdb6-ZwI2AqOfTCClNWn_iAGjdvN/view?usp=sharing
LDM CelebAHQ FFHQ https://drive.google.com/drive/folders/1eeO9E4zLTdy1PfPA55YhIwclS9XBF-UI?usp=sharing
SD v1.4 LAION Subset https://drive.google.com/drive/folders/1TNvSc6JMvCqZJ4-9FO-A4-bwjYVReOIc?usp=sharing
SD v2.1 LAION Subset https://drive.google.com/drive/folders/1qiFMpUfLdZdLWRV-TkmPJ1-AEMmUsF07?usp=sharing

Inversion

We use SSCD to calculate image similarity. Download the sscd_disc_large model in their official repository.

DDPM

Download our pretrained DDPM and run the following command to perform inversion and calculate memorization scores:

python inversion.py --logdir logs/DDPM_CIFAR10_EPS_INVERSION

Latent Diffusion

We provide pretrained models on the subsets of CelebAHQ and FFHQ. Pretrained models on the full datasets can be found in the official repository.

To perform inversion:

python inversion -dp /path/to/dataset --ckpt_file /path/to/pretrained_model

Stable Diffusion

Download pretrained SD v1.4 and SD v2.1, and then run:

python inversion -dp /path/to/dataset

LICENSE

Each model follows their original license.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages