Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gwang-kim committed Apr 22, 2022
1 parent 9a647f0 commit 8c2a944
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 32 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ DiffusionCLIP resolves the critical issues in zero-shot manipulation with the fo
- **Our method takes another step towards <span style="color:red">general application</span> by manipulating images from a <span style="color:red">widely varying ImageNet</span> dataset**.
- Finally, our **zero-shot translation between unseen domains** and **multi-attribute transfer** can effectively reduce manual intervention.

The training process is illustreted in the following figure:
The training process is illustrated in the following figure. **Once the diffusion model is fine-tuned, any image from the pretrained domain can be manipulated into the corresponding to the target text without re-training**:

![](imgs/method1.png)

Expand Down
65 changes: 34 additions & 31 deletions data_download.sh
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
"""
Modified version of download.sh in https://github.com/naver-ai/StyleMapGAN
"""

DATASET=$1
BASE_DIR=$2

if [ $DATASET == "celeba_hq" ] || [ $DATASET == "afhq" ]; then
if [ $DATASET == "celeba_hq" ]; then
URL_ID="1R72NB79CX0MpnmWSli2SMu-Wp-M0xI-o"
DATASET_FOLDER=$BASE_DIR/data/celeba_hq
ZIP_FILE=$DATASET_FOLDER/celeba_hq_raw.zip
elif [ $DATASET == "afhq" ]; then
URL_ID="1Pf4f6Y27lQX9y9vjeSQnoOQntw_ln7il"
DATASET_FOLDER=$BASE_DIR/data/afhq
ZIP_FILE=$DATASET_FOLDER/afhq_raw.zip
else
echo "Unknown DATASET"
exit 1
fi

echo "lalala"
mkdir -p $DATASET_FOLDER

wget --load-cookies ~/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies ~/cookies.txt --keep-session-cookies --no-check-certificate "https://docs.google.com/uc?export=download&id=${URL_ID}" -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=${URL_ID}" -O $ZIP_FILE && rm -rf ~/cookies.txt
unzip $ZIP_FILE -d $DATASET_FOLDER
rm $ZIP_FILE

# raw images to LMDB format
TARGET_SIZE=256,1024
for DATASET_TYPE in "train" "test" "val"; do
python utils/prepare_lmdb_data.py --out $DATASET_FOLDER/LMDB_$DATASET_TYPE --size $TARGET_SIZE $DATASET_FOLDER/raw_images/$DATASET_TYPE
done

else
echo "Unknown DATASET"
exit 1
fi
if [ $DATASET == "celeba_hq" ]; then
URL="https://docs.google.com/uc?export=download&id=1R72NB79CX0MpnmWSli2SMu-Wp-M0xI-o"
DATASET_FOLDER="./data/celeba_hq"
ZIP_FILE=$DATASET_FOLDER/celeba_hq_raw.zip
elif [ $DATASET == "afhq" ]; then
URL="https://docs.google.com/uc?export=download&id=1Pf4f6Y27lQX9y9vjeSQnoOQntw_ln7il"
DATASET_FOLDER="./data/afhq"
ZIP_FILE=$DATASET_FOLDER/afhq_raw.zip
else
echo "Unknown DATASET"
exit 1
fi
mkdir -p $DATASET_FOLDER
wget --no-check-certificate -r $URL -O $ZIP_FILE
wget --load-cookies ~/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies ~/cookies.txt --keep-session-cookies --no-check-certificate $URL -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1R72NB79CX0MpnmWSli2SMu-Wp-M0xI-o" -O $ZIP_FILE && rm -rf ~/cookies.txt
unzip $ZIP_FILE -d $DATASET_FOLDER
rm $ZIP_FILE

# raw images to LMDB format
TARGET_SIZE=256,1024
for DATASET_TYPE in "train" "test" "val"; do
python utils/prepare_lmdb_data.py --out $DATASET_FOLDER/LMDB_$DATASET_TYPE --size $TARGET_SIZE $DATASET_FOLDER/raw_images/$DATASET_TYPE
done




wget --load-cookies ~/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies ~/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1R72NB79CX0MpnmWSli2SMu-Wp-M0xI-o' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1R72NB79CX0MpnmWSli2SMu-Wp-M0xI-o" -O a.zip && rm -rf ~/cookies.txt

0 comments on commit 8c2a944

Please sign in to comment.