forked from OFA-Sys/Chinese-CLIP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
84 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"vocab_size": 21128, | ||
"text_attention_probs_dropout_prob": 0.1, | ||
"text_hidden_act": "gelu", | ||
"text_hidden_dropout_prob": 0.1, | ||
"text_hidden_size": 768, | ||
"text_initializer_range": 0.02, | ||
"text_intermediate_size": 3072, | ||
"text_max_position_embeddings": 512, | ||
"text_num_attention_heads": 12, | ||
"text_num_hidden_layers": 3, | ||
"text_type_vocab_size": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"embed_dim": 1024, | ||
"image_resolution": 224, | ||
"vision_layers": "[3,4,6,3]", | ||
"vision_width": 64, | ||
"vision_patch_size": null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env | ||
|
||
# NOTE: We have not officially released our zero-shot classification pipeline yet. | ||
# This script and its corresponding python entryfile may be changed in further releases. | ||
|
||
# usage: bash run_scripts/imagenet_zeroshot_eval.sh CKPT_PATH | ||
|
||
# only supports single-GPU inference | ||
export CUDA_VISIBLE_DEVICES=0 | ||
export PYTHONPATH=${PYTHONPATH}:`pwd`/cn_clip | ||
|
||
DATAPATH=../imagenet-1k_val # provide the path of imagenet-val directory in torchvision dataset format | ||
resume=${1} | ||
vision_model=${2:-ViT-B-16} | ||
|
||
python -u cn_clip/eval/zeroshot_evaluation.py \ | ||
--imagenet-val="${DATAPATH}" \ | ||
--img-batch-size=64 \ | ||
--context-length=32 \ | ||
--resume=${resume} \ | ||
--vision-model=${vision_model} \ | ||
--text-model=RoBERTa-wwm-ext-base-chinese |