#!/bin/bash
set -e

export CUDA_VISIBLE_DEVICES=1,2,5,6

VQA_DIR=/path/to/VQA_v2
SUBSET_IMG_DIR=/path/to/VQA_v2/sample500_images
DEPTH_DIR=/path/to/VQA_v2/sample500_depth
OUT_DIR=./output/VQA_v2
MODEL=Qwen/Qwen2.5-VL-7B-Instruct

PROJECT_ROOT=/path/to/experiments
mkdir -p "${OUT_DIR}"
cd "${PROJECT_ROOT}"

echo "[STEP] Run DSCR Qwen2.5 VL on VQA subset"
python ./eval/qwen25_vl_vqa.py \
  --model-path "${MODEL}" \
  --image-folder "${SUBSET_IMG_DIR}" \
  --question-file "${VQA_DIR}/sample500_questions.json" \
  --gt-file "${VQA_DIR}/sample500_answers.json" \
  --answers-file "${OUT_DIR}/qwen25_dscr_sample500.jsonl" \
  --max-new-tokens 8 \
  --format ow_format \
  --device-map auto \
  --use_dscr \
  --depth-folder "${DEPTH_DIR}" \
  --dscr-alpha 0.4 \
  --dscr-beta 0.6 \
  --dscr-sigma 0.4 \
  --dscr-start-layer 0 \
  --dscr-end-layer 4 \
  --dscr-lambda 0.05 \
  --dscr-self-keep 1.0 \
  --dscr-key-only

echo "[DONE] Qwen2.5 DSCR VQA evaluation finished."
