NIPS2024 paper 2690

# Usage of the Repo


## environments
conda create -n DM2 python=3.7.16
conda activate DM2
pip install requirements.txt


## before start
1. Please modify all paths in *config.json*.
2. Please modify *erased_concept* in *config.json* (default: sexual).
3. Place the pertrained model *stable_diffusion_v1_4.pth* in the folder *configs*.
4. If you want to evaluate, please download the file from https://openaipublic.blob.core.windows.net/diffusion/jul-2021/ref_batches/classify_image_graph_def.pb and put it in the folder *eval*, and download the file from https://openaipublic.blob.core.windows.net/diffusion/jul-2021/ref_batches/imagenet/256/VIRTUAL_imagenet256_labeled.npz and put it in the folder *eval*.


## train
sh ./scripts/run.sh ./experiments/examples/config.json device_id

## generate
sh ./scripts/generate.sh ./experiments/examples/config.json device_id

## eval
sh ./scripts/eval.sh nsfw_img_path coco_img_path ./experiments/examples device_id