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

source .venv/bin/activate
which python
python -V

nvidia-smi

export WANDB_MODE="offline"

export CONCEPT="dog6"
export CLASS="dog"
export CLASSDIR="dog"
export DB_EXP="00000-3417-dog6-lr2"
export DDPO_EXP_ID=166
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/dreambooth/$DB_EXP/eval.json \
    --img_root experiments/dreambooth/$DB_EXP/checkpoint-400/samples/ns50_gs7.5/version_0 \
    --prompts_path data/$CLASSDIR/$NPROMPTS-10-parts/0.json \
    --concept "sks $CLASS" \
    --out_path data/$CLASSDIR/$NPROMPTS-$CONCEPT-a${ANGLE_MIN}_${ANGLE_MAX}-10-parts/0.json \
    --exp_key "('$DB_EXP', ('400', '50', '7.5'))" \
    --score_type text \
    --threshold 0.0 \
    --atan_min $ANGLE_MIN \
    --atan_max $ANGLE_MAX
echo "Finished (pairs): $(date)"

python pipeline.py \
    --pretrained_model_or_path experiments/dreambooth/00000-0400-dog6-lr2-ckpt400 \
    --base_dir experiments/ddpo \
    --prompts_dir data/$CLASSDIR/$NPROMPTS-10-parts \
    --pairs_dir data/$CLASSDIR/$NPROMPTS-$CONCEPT-a${ANGLE_MIN}_${ANGLE_MAX}-10-parts \
    --concept $CONCEPT \
    --concept_class "$CLASS" \
    --exp_id $DDPO_EXP_ID \
    --exp_name $DDPO_EXP_NAME-a${ANGLE_MIN}_${ANGLE_MAX} \
    --n_steps 10 \
    --train_steps_per_dpo_step 50 \
    --checkpoint_steps 50 \
    --global_threshold 0.0 \
    --atan_min $ANGLE_MIN \
    --atan_max $ANGLE_MAX
echo "Finished (train): $(date)"
