Skip to content

Commit

Permalink
update classnames and templates
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinLin610 committed Nov 22, 2022
1 parent bed51c6 commit 814f976
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions cn_clip/eval/zeroshot_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from cn_clip.training.main import convert_models_to_fp32
from cn_clip.clip.utils import image_transform
from cn_clip.eval.data import get_zeroshot_dataset, _preprocess_text
from cn_clip.eval.imagenet_zeroshot_templates import imagenet_classnames, openai_imagenet_template
from cn_clip.eval.cvinw_zeroshot_templates import (
openai_templates,
flower_templates,
Expand Down Expand Up @@ -251,7 +250,7 @@ def run(model, classifier, dataloader, args):

# Make inference and evaluation
print('Using classifier')
classifier = zero_shot_classifier(model, imagenet_classnames, openai_imagenet_template, args)
classifier = zero_shot_classifier(model, classnames, templates, args)
results = {}
top1, top5, logits = run(model, classifier, data[args.dataset].dataloader, args)

Expand Down
2 changes: 1 addition & 1 deletion run_scripts/zeroshot_eval.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resume=${5}
label_file=${path}/${dataset}/label_cn.txt
index=${6:-}

python -u src/eval/zeroshot_evaluation.py \
python -u cn_clip/eval/zeroshot_evaluation.py \
--datapath="${datapath}" \
--label-file=${label_file} \
--save-dir=${savedir} \
Expand Down

0 comments on commit 814f976

Please sign in to comment.