QA-CLIP / scripts /zeroshot_eval.sh
kunyi
Upload 30 files
f76d30f
raw
history blame
812 Bytes
#!/bin/bash
# Usage: see example script below.
# bash run_scripts/zeroshot_eval.sh 0 \
# ${path_to_dataset} ${dataset_name} \
# ViT-B-16 RoBERTa-wwm-ext-base-chinese \
# ${ckpt_path}
# only supports single-GPU inference
export CUDA_VISIBLE_DEVICES=${1}
export PYTHONPATH=${PYTHONPATH}:`pwd`/QA-CLIP-main
path=${2}
dataset=${3}
datapath=${path}
savedir=`pwd`/save_predictions
vision_model=${4} # ViT-B-16
text_model=${5}
resume=${6}
label_file=`pwd`/label_cn.txt
index=${7:-}
mkdir -p ${savedir}
python -u eval/zeroshot_evaluation.py \
--datapath="${datapath}" \
--label-file=${label_file} \
--save-dir=${savedir} \
--dataset=${dataset} \
--index=${index} \
--img-batch-size=64 \
--resume=${resume} \
--vision-model=${vision_model} \
--text-model=${text_model}