Skip to content

Commit

Permalink
add direct support for multilingual eval in run.sh (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
rom1504 authored Nov 23, 2022
1 parent 0e9fbd9 commit e5ade28
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
12 changes: 12 additions & 0 deletions benchmark/datasets_multilingual.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
multilingual_mscoco_captions,es
multilingual_mscoco_captions,it
multilingual_mscoco_captions,ko
multilingual_mscoco_captions,pl
multilingual_mscoco_captions,ru
multilingual_mscoco_captions,tr
multilingual_mscoco_captions,zh
multilingual_mscoco_captions,en
imagenet1k,zh
imagenet1k,it
imagenet1k,jp
imagenet1k,en
8 changes: 7 additions & 1 deletion benchmark/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ WORKERS=4
MODEL=$1
PRETRAINED=$2
ROOT=clip_benchmark_datasets
LANGUAGE=en
for ds in $DATASETS;do
LANGUAGE=$(echo $ds|cut -d, -f2)
ds=$(echo $ds|cut -d, -f1)
ds_name=`echo $ds|tr '/' '_'`
if [[ "$LANGUAGE" == "" ]]
then
$LANGUAGE="en"
fi
for model in $MODELS;do
arch=$(echo $model|cut -d, -f1)
pretrained=$(echo $model|cut -d, -f2)
Expand All @@ -20,6 +25,7 @@ for ds in $DATASETS;do
TASK=zeroshot_classification
fi
echo "$ds_name"
echo "$LANGUAGE"
echo $TASK
$RUN --dataset=$ds --language=$LANGUAGE --annotation_file=$ROOT/$ds/captions.txt --dataset_root $ROOT/$ds --task=$TASK --pretrained=$pretrained --model=$arch --output="${ds_name}_${name}_${arch}_${LANGUAGE}.json" --batch_size=$BS --num_workers=$WORKERS
done
Expand Down

0 comments on commit e5ade28

Please sign in to comment.