scripts/pipeline_svd.sh
#!/bin/bash
set -ex

# module restore
source .venv/bin/activate
which python
python -V

nvidia-smi

export WANDB_MODE="offline"

export CONCEPT="vase"
export CLASS="vase"
export CLASSDIR="vase"
export SVD_EXP="00013-d48d-vase_SVDDiff"
export DDPO_EXP_ID=30

export DDPO_EXP_NAME="$CONCEPT-s1k"
export ANGLE_MIN=-20
export ANGLE_MAX=70
export NPROMPTS=1000

echo "Started: $(date)"
python collect_pairs.py \
    --meta_path experiments/svddiff/$SVD_EXP/eval.json \
    --img_root experiments/svddiff/$SVD_EXP/checkpoint-1600/samples/ns50_gs7.5/version_0 \
    --prompts_path data/$CLASSDIR/$NPROMPTS-2-parts/0.json \
    --concept "sks $CLASS" \
    --out_path data/$CLASSDIR/$NPROMPTS-$CONCEPT-svd-a${ANGLE_MIN}_${ANGLE_MAX}-2-parts/0.json \
    --exp_key "('$SVD_EXP', ('1600', '50', '7.5'))" \
    --score_type text \
    --threshold 0.0 \
    --atan_min $ANGLE_MIN \
    --atan_max $ANGLE_MAX
echo "Finished (pairs: $ANGLE_MIN, $ANGLE_MAX): $(date)"

python pipeline_svd.py \
    --base_svd_ckpt experiments/svddiff/$SVD_EXP/checkpoint-1600 \
    --base_dir experiments/svddiff_ddpo \
    --prompts_dir data/$CLASSDIR/$NPROMPTS-2-parts \
    --pairs_dir data/$CLASSDIR/$NPROMPTS-$CONCEPT-svd-a${ANGLE_MIN}_${ANGLE_MAX}-2-parts \
    --concept $CONCEPT \
    --concept_class "$CLASS" \
    --exp_id $DDPO_EXP_ID \
    --exp_name $DDPO_EXP_NAME-a${ANGLE_MIN}_${ANGLE_MAX} \
    --n_steps 2 \
    --train_steps_per_dpo_step 250 \
    --checkpoint_steps 50 \
    --global_threshold 0.0 \
    --atan_min $ANGLE_MIN \
    --atan_max $ANGLE_MAX
echo "Finished (train: $ANGLE_MIN, $ANGLE_MAX): $(date)"

export CONCEPT="wolf_plushie"
export CLASS="stuffed animal"
export CLASSDIR="stuffed_animal"
export SVD_EXP="00014-96c5-wolf_plushie_SVDDiff"
export DDPO_EXP_ID=31

export DDPO_EXP_NAME="$CONCEPT-s1k"
export ANGLE_MIN=-20
export ANGLE_MAX=70
export NPROMPTS=1000

echo "Started: $(date)"
python collect_pairs.py \
    --meta_path experiments/svddiff/$SVD_EXP/eval.json \
    --img_root experiments/svddiff/$SVD_EXP/checkpoint-1600/samples/ns50_gs7.5/version_0 \
    --prompts_path data/$CLASSDIR/$NPROMPTS-2-parts/0.json \
    --concept "sks $CLASS" \
    --out_path data/$CLASSDIR/$NPROMPTS-$CONCEPT-svd-a${ANGLE_MIN}_${ANGLE_MAX}-2-parts/0.json \
    --exp_key "('$SVD_EXP', ('1600', '50', '7.5'))" \
    --score_type text \
    --threshold 0.0 \
    --atan_min $ANGLE_MIN \
    --atan_max $ANGLE_MAX
echo "Finished (pairs: $ANGLE_MIN, $ANGLE_MAX): $(date)"

python pipeline_svd.py \
    --base_svd_ckpt experiments/svddiff/$SVD_EXP/checkpoint-1600 \
    --base_dir experiments/svddiff_ddpo \
    --prompts_dir data/$CLASSDIR/$NPROMPTS-2-parts \
    --pairs_dir data/$CLASSDIR/$NPROMPTS-$CONCEPT-svd-a${ANGLE_MIN}_${ANGLE_MAX}-2-parts \
    --concept $CONCEPT \
    --concept_class "$CLASS" \
    --exp_id $DDPO_EXP_ID \
    --exp_name $DDPO_EXP_NAME-a${ANGLE_MIN}_${ANGLE_MAX} \
    --n_steps 2 \
    --train_steps_per_dpo_step 250 \
    --checkpoint_steps 50 \
    --global_threshold 0.0 \
    --atan_min $ANGLE_MIN \
    --atan_max $ANGLE_MAX
echo "Finished (train: $ANGLE_MIN, $ANGLE_MAX): $(date)"