Add files using upload-large-folder tool
Browse files- 之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/measure_attention_head/measure_attention_head_VGMED_LLaVA_13B.sh +21 -0
- 之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_diff_both.sh +47 -0
- 之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_diff_region.sh +47 -0
- 之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_diff_text.sh +47 -0
- 之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_image_only.sh +47 -0
- 之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_keep_both.sh +47 -0
- 之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_keep_region.sh +47 -0
- 之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_keep_text.sh +47 -0
- 之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_mask_both.sh +48 -0
- 之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_mask_both_random.sh +47 -0
- 之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_mask_region.sh +47 -0
- 之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_mask_region_random.sh +47 -0
- 之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_mask_text.sh +47 -0
- 之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_mask_text_random.sh +47 -0
- 之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_measure_attention.sh +48 -0
- 之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_measure_attention_head.sh +47 -0
- 之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_text_only.sh +47 -0
- 之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/models/HealthGPT/.ipynb_checkpoints/HealthGPT-checkpoint.py +173 -0
- 之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/models/HealthGPT/.ipynb_checkpoints/HealthGPT_phi-checkpoint.py +169 -0
- 之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/models/HealthGPT/llava/demo/com_infer_phi4.sh +18 -0
之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/measure_attention_head/measure_attention_head_VGMED_LLaVA_13B.sh
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# export HF_ENDPOINT=https://hf-mirror.com
|
| 3 |
+
cd "$(dirname "$0")/../.."
|
| 4 |
+
|
| 5 |
+
MODEL_PATH="llava-hf/llava-v1.6-vicuna-13b-hf"
|
| 6 |
+
VGMED_ROOT="../benchmarks/VGMED"
|
| 7 |
+
OUTPUT_ROOT="attention_results/LLaVA-13B"
|
| 8 |
+
|
| 9 |
+
python measure_attention_head.py \
|
| 10 |
+
--dataset VGMED \
|
| 11 |
+
--q_type localization \
|
| 12 |
+
--model_path "$MODEL_PATH" \
|
| 13 |
+
--vgmed_root "$VGMED_ROOT" \
|
| 14 |
+
--output_root "$OUTPUT_ROOT"
|
| 15 |
+
|
| 16 |
+
# python measure_attention_head.py \
|
| 17 |
+
# --dataset VGMED \
|
| 18 |
+
# --q_type attribute \
|
| 19 |
+
# --model_path "$MODEL_PATH" \
|
| 20 |
+
# --vgmed_root "$VGMED_ROOT" \
|
| 21 |
+
# --output_root "$OUTPUT_ROOT"
|
之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_diff_both.sh
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# run_all_diff_both: grounding_diff_both.py
|
| 3 |
+
export CUDA_VISIBLE_DEVICES=0
|
| 4 |
+
cd "$(dirname "$0")/.."
|
| 5 |
+
|
| 6 |
+
echo "=== [qianwen] Qwen25VL_7B COCO ==="
|
| 7 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/diff_both/diff_both_COCO_Qwen25VL_7B.sh
|
| 8 |
+
echo "=== [qianwen] Qwen25VL_7B VGMED ==="
|
| 9 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/diff_both/diff_both_VGMED_Qwen25VL_7B.sh
|
| 10 |
+
echo "=== [qianwen] Qwen25VL_3B COCO ==="
|
| 11 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/diff_both/diff_both_COCO_Qwen25VL_3B.sh
|
| 12 |
+
echo "=== [qianwen] Qwen25VL_3B VGMED ==="
|
| 13 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/diff_both/diff_both_VGMED_Qwen25VL_3B.sh
|
| 14 |
+
echo "=== [qianwen] Qwen25VL_32B COCO ==="
|
| 15 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/diff_both/diff_both_COCO_Qwen25VL_32B.sh
|
| 16 |
+
echo "=== [qianwen] Qwen25VL_32B VGMED ==="
|
| 17 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/diff_both/diff_both_VGMED_Qwen25VL_32B.sh
|
| 18 |
+
echo "=== [llava-natural] LLaVA_7B COCO ==="
|
| 19 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/diff_both/diff_both_COCO_LLaVA_7B.sh
|
| 20 |
+
echo "=== [llava-natural] LLaVA_7B VGMED ==="
|
| 21 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/diff_both/diff_both_VGMED_LLaVA_7B.sh
|
| 22 |
+
echo "=== [llava-natural] LLaVA_13B COCO ==="
|
| 23 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/diff_both/diff_both_COCO_LLaVA_13B.sh
|
| 24 |
+
echo "=== [llava-natural] LLaVA_13B VGMED ==="
|
| 25 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/diff_both/diff_both_VGMED_LLaVA_13B.sh
|
| 26 |
+
echo "=== [llava-med] LLaVA_Med_7B COCO ==="
|
| 27 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/diff_both/diff_both_COCO_LLaVA_Med_7B.sh
|
| 28 |
+
echo "=== [llava-med] LLaVA_Med_7B VGMED ==="
|
| 29 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/diff_both/diff_both_VGMED_LLaVA_Med_7B.sh
|
| 30 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B COCO ==="
|
| 31 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/diff_both/diff_both_COCO_HuatuoGPT_V_7B.sh
|
| 32 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B VGMED ==="
|
| 33 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/diff_both/diff_both_VGMED_HuatuoGPT_V_7B.sh
|
| 34 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B COCO ==="
|
| 35 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/diff_both/diff_both_COCO_HuatuoGPT_V_34B.sh
|
| 36 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B VGMED ==="
|
| 37 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/diff_both/diff_both_VGMED_HuatuoGPT_V_34B.sh
|
| 38 |
+
echo "=== [gemma] MedGemma_4B_IT COCO ==="
|
| 39 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/diff_both/diff_both_COCO_MedGemma_4B_IT.sh
|
| 40 |
+
echo "=== [gemma] MedGemma_4B_IT VGMED ==="
|
| 41 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/diff_both/diff_both_VGMED_MedGemma_4B_IT.sh
|
| 42 |
+
echo "=== [gemma] MedGemma_27B_IT COCO ==="
|
| 43 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/diff_both/diff_both_COCO_MedGemma_27B_IT.sh
|
| 44 |
+
echo "=== [gemma] MedGemma_27B_IT VGMED ==="
|
| 45 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/diff_both/diff_both_VGMED_MedGemma_27B_IT.sh
|
| 46 |
+
|
| 47 |
+
echo "All diff_both jobs finished."
|
之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_diff_region.sh
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# run_all_diff_region: grounding_diff_region.py
|
| 3 |
+
export CUDA_VISIBLE_DEVICES=0
|
| 4 |
+
cd "$(dirname "$0")/.."
|
| 5 |
+
|
| 6 |
+
echo "=== [qianwen] Qwen25VL_7B COCO ==="
|
| 7 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/diff_region/diff_region_COCO_Qwen25VL_7B.sh
|
| 8 |
+
echo "=== [qianwen] Qwen25VL_7B VGMED ==="
|
| 9 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/diff_region/diff_region_VGMED_Qwen25VL_7B.sh
|
| 10 |
+
echo "=== [qianwen] Qwen25VL_3B COCO ==="
|
| 11 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/diff_region/diff_region_COCO_Qwen25VL_3B.sh
|
| 12 |
+
echo "=== [qianwen] Qwen25VL_3B VGMED ==="
|
| 13 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/diff_region/diff_region_VGMED_Qwen25VL_3B.sh
|
| 14 |
+
echo "=== [qianwen] Qwen25VL_32B COCO ==="
|
| 15 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/diff_region/diff_region_COCO_Qwen25VL_32B.sh
|
| 16 |
+
echo "=== [qianwen] Qwen25VL_32B VGMED ==="
|
| 17 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/diff_region/diff_region_VGMED_Qwen25VL_32B.sh
|
| 18 |
+
echo "=== [llava-natural] LLaVA_7B COCO ==="
|
| 19 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/diff_region/diff_region_COCO_LLaVA_7B.sh
|
| 20 |
+
echo "=== [llava-natural] LLaVA_7B VGMED ==="
|
| 21 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/diff_region/diff_region_VGMED_LLaVA_7B.sh
|
| 22 |
+
echo "=== [llava-natural] LLaVA_13B COCO ==="
|
| 23 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/diff_region/diff_region_COCO_LLaVA_13B.sh
|
| 24 |
+
echo "=== [llava-natural] LLaVA_13B VGMED ==="
|
| 25 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/diff_region/diff_region_VGMED_LLaVA_13B.sh
|
| 26 |
+
echo "=== [llava-med] LLaVA_Med_7B COCO ==="
|
| 27 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/diff_region/diff_region_COCO_LLaVA_Med_7B.sh
|
| 28 |
+
echo "=== [llava-med] LLaVA_Med_7B VGMED ==="
|
| 29 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/diff_region/diff_region_VGMED_LLaVA_Med_7B.sh
|
| 30 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B COCO ==="
|
| 31 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/diff_region/diff_region_COCO_HuatuoGPT_V_7B.sh
|
| 32 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B VGMED ==="
|
| 33 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/diff_region/diff_region_VGMED_HuatuoGPT_V_7B.sh
|
| 34 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B COCO ==="
|
| 35 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/diff_region/diff_region_COCO_HuatuoGPT_V_34B.sh
|
| 36 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B VGMED ==="
|
| 37 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/diff_region/diff_region_VGMED_HuatuoGPT_V_34B.sh
|
| 38 |
+
echo "=== [gemma] MedGemma_4B_IT COCO ==="
|
| 39 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/diff_region/diff_region_COCO_MedGemma_4B_IT.sh
|
| 40 |
+
echo "=== [gemma] MedGemma_4B_IT VGMED ==="
|
| 41 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/diff_region/diff_region_VGMED_MedGemma_4B_IT.sh
|
| 42 |
+
echo "=== [gemma] MedGemma_27B_IT COCO ==="
|
| 43 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/diff_region/diff_region_COCO_MedGemma_27B_IT.sh
|
| 44 |
+
echo "=== [gemma] MedGemma_27B_IT VGMED ==="
|
| 45 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/diff_region/diff_region_VGMED_MedGemma_27B_IT.sh
|
| 46 |
+
|
| 47 |
+
echo "All diff_region jobs finished."
|
之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_diff_text.sh
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# run_all_diff_text: grounding_diff_text.py
|
| 3 |
+
export CUDA_VISIBLE_DEVICES=0
|
| 4 |
+
cd "$(dirname "$0")/.."
|
| 5 |
+
|
| 6 |
+
echo "=== [qianwen] Qwen25VL_7B COCO ==="
|
| 7 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/diff_text/diff_text_COCO_Qwen25VL_7B.sh
|
| 8 |
+
echo "=== [qianwen] Qwen25VL_7B VGMED ==="
|
| 9 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/diff_text/diff_text_VGMED_Qwen25VL_7B.sh
|
| 10 |
+
echo "=== [qianwen] Qwen25VL_3B COCO ==="
|
| 11 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/diff_text/diff_text_COCO_Qwen25VL_3B.sh
|
| 12 |
+
echo "=== [qianwen] Qwen25VL_3B VGMED ==="
|
| 13 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/diff_text/diff_text_VGMED_Qwen25VL_3B.sh
|
| 14 |
+
echo "=== [qianwen] Qwen25VL_32B COCO ==="
|
| 15 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/diff_text/diff_text_COCO_Qwen25VL_32B.sh
|
| 16 |
+
echo "=== [qianwen] Qwen25VL_32B VGMED ==="
|
| 17 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/diff_text/diff_text_VGMED_Qwen25VL_32B.sh
|
| 18 |
+
echo "=== [llava-natural] LLaVA_7B COCO ==="
|
| 19 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/diff_text/diff_text_COCO_LLaVA_7B.sh
|
| 20 |
+
echo "=== [llava-natural] LLaVA_7B VGMED ==="
|
| 21 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/diff_text/diff_text_VGMED_LLaVA_7B.sh
|
| 22 |
+
echo "=== [llava-natural] LLaVA_13B COCO ==="
|
| 23 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/diff_text/diff_text_COCO_LLaVA_13B.sh
|
| 24 |
+
echo "=== [llava-natural] LLaVA_13B VGMED ==="
|
| 25 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/diff_text/diff_text_VGMED_LLaVA_13B.sh
|
| 26 |
+
echo "=== [llava-med] LLaVA_Med_7B COCO ==="
|
| 27 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/diff_text/diff_text_COCO_LLaVA_Med_7B.sh
|
| 28 |
+
echo "=== [llava-med] LLaVA_Med_7B VGMED ==="
|
| 29 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/diff_text/diff_text_VGMED_LLaVA_Med_7B.sh
|
| 30 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B COCO ==="
|
| 31 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/diff_text/diff_text_COCO_HuatuoGPT_V_7B.sh
|
| 32 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B VGMED ==="
|
| 33 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/diff_text/diff_text_VGMED_HuatuoGPT_V_7B.sh
|
| 34 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B COCO ==="
|
| 35 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/diff_text/diff_text_COCO_HuatuoGPT_V_34B.sh
|
| 36 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B VGMED ==="
|
| 37 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/diff_text/diff_text_VGMED_HuatuoGPT_V_34B.sh
|
| 38 |
+
echo "=== [gemma] MedGemma_4B_IT COCO ==="
|
| 39 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/diff_text/diff_text_COCO_MedGemma_4B_IT.sh
|
| 40 |
+
echo "=== [gemma] MedGemma_4B_IT VGMED ==="
|
| 41 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/diff_text/diff_text_VGMED_MedGemma_4B_IT.sh
|
| 42 |
+
echo "=== [gemma] MedGemma_27B_IT COCO ==="
|
| 43 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/diff_text/diff_text_COCO_MedGemma_27B_IT.sh
|
| 44 |
+
echo "=== [gemma] MedGemma_27B_IT VGMED ==="
|
| 45 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/diff_text/diff_text_VGMED_MedGemma_27B_IT.sh
|
| 46 |
+
|
| 47 |
+
echo "All diff_text jobs finished."
|
之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_image_only.sh
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# run_all_image_only: grounding_image_only.py
|
| 3 |
+
export CUDA_VISIBLE_DEVICES=0
|
| 4 |
+
cd "$(dirname "$0")/.."
|
| 5 |
+
|
| 6 |
+
echo "=== [qianwen] Qwen25VL_7B COCO ==="
|
| 7 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/image_only/image_only_COCO_Qwen25VL_7B.sh
|
| 8 |
+
echo "=== [qianwen] Qwen25VL_7B VGMED ==="
|
| 9 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/image_only/image_only_VGMED_Qwen25VL_7B.sh
|
| 10 |
+
echo "=== [qianwen] Qwen25VL_3B COCO ==="
|
| 11 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/image_only/image_only_COCO_Qwen25VL_3B.sh
|
| 12 |
+
echo "=== [qianwen] Qwen25VL_3B VGMED ==="
|
| 13 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/image_only/image_only_VGMED_Qwen25VL_3B.sh
|
| 14 |
+
echo "=== [qianwen] Qwen25VL_32B COCO ==="
|
| 15 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/image_only/image_only_COCO_Qwen25VL_32B.sh
|
| 16 |
+
echo "=== [qianwen] Qwen25VL_32B VGMED ==="
|
| 17 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/image_only/image_only_VGMED_Qwen25VL_32B.sh
|
| 18 |
+
echo "=== [llava-natural] LLaVA_7B COCO ==="
|
| 19 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/image_only/image_only_COCO_LLaVA_7B.sh
|
| 20 |
+
echo "=== [llava-natural] LLaVA_7B VGMED ==="
|
| 21 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/image_only/image_only_VGMED_LLaVA_7B.sh
|
| 22 |
+
echo "=== [llava-natural] LLaVA_13B COCO ==="
|
| 23 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/image_only/image_only_COCO_LLaVA_13B.sh
|
| 24 |
+
echo "=== [llava-natural] LLaVA_13B VGMED ==="
|
| 25 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/image_only/image_only_VGMED_LLaVA_13B.sh
|
| 26 |
+
echo "=== [llava-med] LLaVA_Med_7B COCO ==="
|
| 27 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/image_only/image_only_COCO_LLaVA_Med_7B.sh
|
| 28 |
+
echo "=== [llava-med] LLaVA_Med_7B VGMED ==="
|
| 29 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/image_only/image_only_VGMED_LLaVA_Med_7B.sh
|
| 30 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B COCO ==="
|
| 31 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/image_only/image_only_COCO_HuatuoGPT_V_7B.sh
|
| 32 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B VGMED ==="
|
| 33 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/image_only/image_only_VGMED_HuatuoGPT_V_7B.sh
|
| 34 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B COCO ==="
|
| 35 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/image_only/image_only_COCO_HuatuoGPT_V_34B.sh
|
| 36 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B VGMED ==="
|
| 37 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/image_only/image_only_VGMED_HuatuoGPT_V_34B.sh
|
| 38 |
+
echo "=== [gemma] MedGemma_4B_IT COCO ==="
|
| 39 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/image_only/image_only_COCO_MedGemma_4B_IT.sh
|
| 40 |
+
echo "=== [gemma] MedGemma_4B_IT VGMED ==="
|
| 41 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/image_only/image_only_VGMED_MedGemma_4B_IT.sh
|
| 42 |
+
echo "=== [gemma] MedGemma_27B_IT COCO ==="
|
| 43 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/image_only/image_only_COCO_MedGemma_27B_IT.sh
|
| 44 |
+
echo "=== [gemma] MedGemma_27B_IT VGMED ==="
|
| 45 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/image_only/image_only_VGMED_MedGemma_27B_IT.sh
|
| 46 |
+
|
| 47 |
+
echo "All image_only jobs finished."
|
之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_keep_both.sh
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# run_all_keep_both: grounding_keep_both.py for all models
|
| 3 |
+
export CUDA_VISIBLE_DEVICES=0
|
| 4 |
+
cd "$(dirname "$0")/.."
|
| 5 |
+
|
| 6 |
+
echo "=== [qianwen] Qwen25VL_7B COCO ==="
|
| 7 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/keep_both/keep_both_COCO_Qwen25VL_7B.sh
|
| 8 |
+
echo "=== [qianwen] Qwen25VL_7B VGMED ==="
|
| 9 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/keep_both/keep_both_VGMED_Qwen25VL_7B.sh
|
| 10 |
+
echo "=== [qianwen] Qwen25VL_3B COCO ==="
|
| 11 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/keep_both/keep_both_COCO_Qwen25VL_3B.sh
|
| 12 |
+
echo "=== [qianwen] Qwen25VL_3B VGMED ==="
|
| 13 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/keep_both/keep_both_VGMED_Qwen25VL_3B.sh
|
| 14 |
+
echo "=== [qianwen] Qwen25VL_32B COCO ==="
|
| 15 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/keep_both/keep_both_COCO_Qwen25VL_32B.sh
|
| 16 |
+
echo "=== [qianwen] Qwen25VL_32B VGMED ==="
|
| 17 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/keep_both/keep_both_VGMED_Qwen25VL_32B.sh
|
| 18 |
+
echo "=== [llava-natural] LLaVA_7B COCO ==="
|
| 19 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/keep_both/keep_both_COCO_LLaVA_7B.sh
|
| 20 |
+
echo "=== [llava-natural] LLaVA_7B VGMED ==="
|
| 21 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/keep_both/keep_both_VGMED_LLaVA_7B.sh
|
| 22 |
+
echo "=== [llava-natural] LLaVA_13B COCO ==="
|
| 23 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/keep_both/keep_both_COCO_LLaVA_13B.sh
|
| 24 |
+
echo "=== [llava-natural] LLaVA_13B VGMED ==="
|
| 25 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/keep_both/keep_both_VGMED_LLaVA_13B.sh
|
| 26 |
+
echo "=== [llava-med] LLaVA_Med_7B COCO ==="
|
| 27 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/keep_both/keep_both_COCO_LLaVA_Med_7B.sh
|
| 28 |
+
echo "=== [llava-med] LLaVA_Med_7B VGMED ==="
|
| 29 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/keep_both/keep_both_VGMED_LLaVA_Med_7B.sh
|
| 30 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B COCO ==="
|
| 31 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/keep_both/keep_both_COCO_HuatuoGPT_V_7B.sh
|
| 32 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B VGMED ==="
|
| 33 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/keep_both/keep_both_VGMED_HuatuoGPT_V_7B.sh
|
| 34 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B COCO ==="
|
| 35 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/keep_both/keep_both_COCO_HuatuoGPT_V_34B.sh
|
| 36 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B VGMED ==="
|
| 37 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/keep_both/keep_both_VGMED_HuatuoGPT_V_34B.sh
|
| 38 |
+
echo "=== [gemma] MedGemma_4B_IT COCO ==="
|
| 39 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/keep_both/keep_both_COCO_MedGemma_4B_IT.sh
|
| 40 |
+
echo "=== [gemma] MedGemma_4B_IT VGMED ==="
|
| 41 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/keep_both/keep_both_VGMED_MedGemma_4B_IT.sh
|
| 42 |
+
echo "=== [gemma] MedGemma_27B_IT COCO ==="
|
| 43 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/keep_both/keep_both_COCO_MedGemma_27B_IT.sh
|
| 44 |
+
echo "=== [gemma] MedGemma_27B_IT VGMED ==="
|
| 45 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/keep_both/keep_both_VGMED_MedGemma_27B_IT.sh
|
| 46 |
+
|
| 47 |
+
echo "All keep_both jobs finished."
|
之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_keep_region.sh
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# run_all_keep_region: grounding_keep_region.py for all models
|
| 3 |
+
export CUDA_VISIBLE_DEVICES=0
|
| 4 |
+
cd "$(dirname "$0")/.."
|
| 5 |
+
|
| 6 |
+
echo "=== [qianwen] Qwen25VL_7B COCO ==="
|
| 7 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/keep_region/keep_region_COCO_Qwen25VL_7B.sh
|
| 8 |
+
echo "=== [qianwen] Qwen25VL_7B VGMED ==="
|
| 9 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/keep_region/keep_region_VGMED_Qwen25VL_7B.sh
|
| 10 |
+
echo "=== [qianwen] Qwen25VL_3B COCO ==="
|
| 11 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/keep_region/keep_region_COCO_Qwen25VL_3B.sh
|
| 12 |
+
echo "=== [qianwen] Qwen25VL_3B VGMED ==="
|
| 13 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/keep_region/keep_region_VGMED_Qwen25VL_3B.sh
|
| 14 |
+
echo "=== [qianwen] Qwen25VL_32B COCO ==="
|
| 15 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/keep_region/keep_region_COCO_Qwen25VL_32B.sh
|
| 16 |
+
echo "=== [qianwen] Qwen25VL_32B VGMED ==="
|
| 17 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/keep_region/keep_region_VGMED_Qwen25VL_32B.sh
|
| 18 |
+
echo "=== [llava-natural] LLaVA_7B COCO ==="
|
| 19 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/keep_region/keep_region_COCO_LLaVA_7B.sh
|
| 20 |
+
echo "=== [llava-natural] LLaVA_7B VGMED ==="
|
| 21 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/keep_region/keep_region_VGMED_LLaVA_7B.sh
|
| 22 |
+
echo "=== [llava-natural] LLaVA_13B COCO ==="
|
| 23 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/keep_region/keep_region_COCO_LLaVA_13B.sh
|
| 24 |
+
echo "=== [llava-natural] LLaVA_13B VGMED ==="
|
| 25 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/keep_region/keep_region_VGMED_LLaVA_13B.sh
|
| 26 |
+
echo "=== [llava-med] LLaVA_Med_7B COCO ==="
|
| 27 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/keep_region/keep_region_COCO_LLaVA_Med_7B.sh
|
| 28 |
+
echo "=== [llava-med] LLaVA_Med_7B VGMED ==="
|
| 29 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/keep_region/keep_region_VGMED_LLaVA_Med_7B.sh
|
| 30 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B COCO ==="
|
| 31 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/keep_region/keep_region_COCO_HuatuoGPT_V_7B.sh
|
| 32 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B VGMED ==="
|
| 33 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/keep_region/keep_region_VGMED_HuatuoGPT_V_7B.sh
|
| 34 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B COCO ==="
|
| 35 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/keep_region/keep_region_COCO_HuatuoGPT_V_34B.sh
|
| 36 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B VGMED ==="
|
| 37 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/keep_region/keep_region_VGMED_HuatuoGPT_V_34B.sh
|
| 38 |
+
echo "=== [gemma] MedGemma_4B_IT COCO ==="
|
| 39 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/keep_region/keep_region_COCO_MedGemma_4B_IT.sh
|
| 40 |
+
echo "=== [gemma] MedGemma_4B_IT VGMED ==="
|
| 41 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/keep_region/keep_region_VGMED_MedGemma_4B_IT.sh
|
| 42 |
+
echo "=== [gemma] MedGemma_27B_IT COCO ==="
|
| 43 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/keep_region/keep_region_COCO_MedGemma_27B_IT.sh
|
| 44 |
+
echo "=== [gemma] MedGemma_27B_IT VGMED ==="
|
| 45 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/keep_region/keep_region_VGMED_MedGemma_27B_IT.sh
|
| 46 |
+
|
| 47 |
+
echo "All keep_region jobs finished."
|
之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_keep_text.sh
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# run_all_keep_text: grounding_keep_text.py for all models
|
| 3 |
+
export CUDA_VISIBLE_DEVICES=0
|
| 4 |
+
cd "$(dirname "$0")/.."
|
| 5 |
+
|
| 6 |
+
echo "=== [qianwen] Qwen25VL_7B COCO ==="
|
| 7 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/keep_text/keep_text_COCO_Qwen25VL_7B.sh
|
| 8 |
+
echo "=== [qianwen] Qwen25VL_7B VGMED ==="
|
| 9 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/keep_text/keep_text_VGMED_Qwen25VL_7B.sh
|
| 10 |
+
echo "=== [qianwen] Qwen25VL_3B COCO ==="
|
| 11 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/keep_text/keep_text_COCO_Qwen25VL_3B.sh
|
| 12 |
+
echo "=== [qianwen] Qwen25VL_3B VGMED ==="
|
| 13 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/keep_text/keep_text_VGMED_Qwen25VL_3B.sh
|
| 14 |
+
echo "=== [qianwen] Qwen25VL_32B COCO ==="
|
| 15 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/keep_text/keep_text_COCO_Qwen25VL_32B.sh
|
| 16 |
+
echo "=== [qianwen] Qwen25VL_32B VGMED ==="
|
| 17 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/keep_text/keep_text_VGMED_Qwen25VL_32B.sh
|
| 18 |
+
echo "=== [llava-natural] LLaVA_7B COCO ==="
|
| 19 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/keep_text/keep_text_COCO_LLaVA_7B.sh
|
| 20 |
+
echo "=== [llava-natural] LLaVA_7B VGMED ==="
|
| 21 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/keep_text/keep_text_VGMED_LLaVA_7B.sh
|
| 22 |
+
echo "=== [llava-natural] LLaVA_13B COCO ==="
|
| 23 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/keep_text/keep_text_COCO_LLaVA_13B.sh
|
| 24 |
+
echo "=== [llava-natural] LLaVA_13B VGMED ==="
|
| 25 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/keep_text/keep_text_VGMED_LLaVA_13B.sh
|
| 26 |
+
echo "=== [llava-med] LLaVA_Med_7B COCO ==="
|
| 27 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/keep_text/keep_text_COCO_LLaVA_Med_7B.sh
|
| 28 |
+
echo "=== [llava-med] LLaVA_Med_7B VGMED ==="
|
| 29 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/keep_text/keep_text_VGMED_LLaVA_Med_7B.sh
|
| 30 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B COCO ==="
|
| 31 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/keep_text/keep_text_COCO_HuatuoGPT_V_7B.sh
|
| 32 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B VGMED ==="
|
| 33 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/keep_text/keep_text_VGMED_HuatuoGPT_V_7B.sh
|
| 34 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B COCO ==="
|
| 35 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/keep_text/keep_text_COCO_HuatuoGPT_V_34B.sh
|
| 36 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B VGMED ==="
|
| 37 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/keep_text/keep_text_VGMED_HuatuoGPT_V_34B.sh
|
| 38 |
+
echo "=== [gemma] MedGemma_4B_IT COCO ==="
|
| 39 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/keep_text/keep_text_COCO_MedGemma_4B_IT.sh
|
| 40 |
+
echo "=== [gemma] MedGemma_4B_IT VGMED ==="
|
| 41 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/keep_text/keep_text_VGMED_MedGemma_4B_IT.sh
|
| 42 |
+
echo "=== [gemma] MedGemma_27B_IT COCO ==="
|
| 43 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/keep_text/keep_text_COCO_MedGemma_27B_IT.sh
|
| 44 |
+
echo "=== [gemma] MedGemma_27B_IT VGMED ==="
|
| 45 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/keep_text/keep_text_VGMED_MedGemma_27B_IT.sh
|
| 46 |
+
|
| 47 |
+
echo "All keep_text jobs finished."
|
之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_mask_both.sh
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# run_all_mask_both: grounding_mask_both.py for all models
|
| 3 |
+
# Env: qianwen -> llava-natural -> llava-med -> huatuogpt -> gemma
|
| 4 |
+
export CUDA_VISIBLE_DEVICES=0
|
| 5 |
+
cd "$(dirname "$0")/.."
|
| 6 |
+
|
| 7 |
+
echo "=== [qianwen] Qwen25VL_7B COCO ==="
|
| 8 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_both/mask_both_COCO_Qwen25VL_7B.sh
|
| 9 |
+
echo "=== [qianwen] Qwen25VL_7B VGMED ==="
|
| 10 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_both/mask_both_VGMED_Qwen25VL_7B.sh
|
| 11 |
+
echo "=== [qianwen] Qwen25VL_3B COCO ==="
|
| 12 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_both/mask_both_COCO_Qwen25VL_3B.sh
|
| 13 |
+
echo "=== [qianwen] Qwen25VL_3B VGMED ==="
|
| 14 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_both/mask_both_VGMED_Qwen25VL_3B.sh
|
| 15 |
+
echo "=== [qianwen] Qwen25VL_32B COCO ==="
|
| 16 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_both/mask_both_COCO_Qwen25VL_32B.sh
|
| 17 |
+
echo "=== [qianwen] Qwen25VL_32B VGMED ==="
|
| 18 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_both/mask_both_VGMED_Qwen25VL_32B.sh
|
| 19 |
+
echo "=== [llava-natural] LLaVA_7B COCO ==="
|
| 20 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_both/mask_both_COCO_LLaVA_7B.sh
|
| 21 |
+
echo "=== [llava-natural] LLaVA_7B VGMED ==="
|
| 22 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_both/mask_both_VGMED_LLaVA_7B.sh
|
| 23 |
+
echo "=== [llava-natural] LLaVA_13B COCO ==="
|
| 24 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_both/mask_both_COCO_LLaVA_13B.sh
|
| 25 |
+
echo "=== [llava-natural] LLaVA_13B VGMED ==="
|
| 26 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_both/mask_both_VGMED_LLaVA_13B.sh
|
| 27 |
+
echo "=== [llava-med] LLaVA_Med_7B COCO ==="
|
| 28 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/mask_both/mask_both_COCO_LLaVA_Med_7B.sh
|
| 29 |
+
echo "=== [llava-med] LLaVA_Med_7B VGMED ==="
|
| 30 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/mask_both/mask_both_VGMED_LLaVA_Med_7B.sh
|
| 31 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B COCO ==="
|
| 32 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_both/mask_both_COCO_HuatuoGPT_V_7B.sh
|
| 33 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B VGMED ==="
|
| 34 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_both/mask_both_VGMED_HuatuoGPT_V_7B.sh
|
| 35 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B COCO ==="
|
| 36 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_both/mask_both_COCO_HuatuoGPT_V_34B.sh
|
| 37 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B VGMED ==="
|
| 38 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_both/mask_both_VGMED_HuatuoGPT_V_34B.sh
|
| 39 |
+
echo "=== [gemma] MedGemma_4B_IT COCO ==="
|
| 40 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_both/mask_both_COCO_MedGemma_4B_IT.sh
|
| 41 |
+
echo "=== [gemma] MedGemma_4B_IT VGMED ==="
|
| 42 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_both/mask_both_VGMED_MedGemma_4B_IT.sh
|
| 43 |
+
echo "=== [gemma] MedGemma_27B_IT COCO ==="
|
| 44 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_both/mask_both_COCO_MedGemma_27B_IT.sh
|
| 45 |
+
echo "=== [gemma] MedGemma_27B_IT VGMED ==="
|
| 46 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_both/mask_both_VGMED_MedGemma_27B_IT.sh
|
| 47 |
+
|
| 48 |
+
echo "All mask_both jobs finished."
|
之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_mask_both_random.sh
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# run_all_mask_both_random: grounding_mask_both_random.py
|
| 3 |
+
export CUDA_VISIBLE_DEVICES=0
|
| 4 |
+
cd "$(dirname "$0")/.."
|
| 5 |
+
|
| 6 |
+
echo "=== [qianwen] Qwen25VL_7B COCO ==="
|
| 7 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_both_random/mask_both_random_COCO_Qwen25VL_7B.sh
|
| 8 |
+
echo "=== [qianwen] Qwen25VL_7B VGMED ==="
|
| 9 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_both_random/mask_both_random_VGMED_Qwen25VL_7B.sh
|
| 10 |
+
echo "=== [qianwen] Qwen25VL_3B COCO ==="
|
| 11 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_both_random/mask_both_random_COCO_Qwen25VL_3B.sh
|
| 12 |
+
echo "=== [qianwen] Qwen25VL_3B VGMED ==="
|
| 13 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_both_random/mask_both_random_VGMED_Qwen25VL_3B.sh
|
| 14 |
+
echo "=== [qianwen] Qwen25VL_32B COCO ==="
|
| 15 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_both_random/mask_both_random_COCO_Qwen25VL_32B.sh
|
| 16 |
+
echo "=== [qianwen] Qwen25VL_32B VGMED ==="
|
| 17 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_both_random/mask_both_random_VGMED_Qwen25VL_32B.sh
|
| 18 |
+
echo "=== [llava-natural] LLaVA_7B COCO ==="
|
| 19 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_both_random/mask_both_random_COCO_LLaVA_7B.sh
|
| 20 |
+
echo "=== [llava-natural] LLaVA_7B VGMED ==="
|
| 21 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_both_random/mask_both_random_VGMED_LLaVA_7B.sh
|
| 22 |
+
echo "=== [llava-natural] LLaVA_13B COCO ==="
|
| 23 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_both_random/mask_both_random_COCO_LLaVA_13B.sh
|
| 24 |
+
echo "=== [llava-natural] LLaVA_13B VGMED ==="
|
| 25 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_both_random/mask_both_random_VGMED_LLaVA_13B.sh
|
| 26 |
+
echo "=== [llava-med] LLaVA_Med_7B COCO ==="
|
| 27 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/mask_both_random/mask_both_random_COCO_LLaVA_Med_7B.sh
|
| 28 |
+
echo "=== [llava-med] LLaVA_Med_7B VGMED ==="
|
| 29 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/mask_both_random/mask_both_random_VGMED_LLaVA_Med_7B.sh
|
| 30 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B COCO ==="
|
| 31 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_both_random/mask_both_random_COCO_HuatuoGPT_V_7B.sh
|
| 32 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B VGMED ==="
|
| 33 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_both_random/mask_both_random_VGMED_HuatuoGPT_V_7B.sh
|
| 34 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B COCO ==="
|
| 35 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_both_random/mask_both_random_COCO_HuatuoGPT_V_34B.sh
|
| 36 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B VGMED ==="
|
| 37 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_both_random/mask_both_random_VGMED_HuatuoGPT_V_34B.sh
|
| 38 |
+
echo "=== [gemma] MedGemma_4B_IT COCO ==="
|
| 39 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_both_random/mask_both_random_COCO_MedGemma_4B_IT.sh
|
| 40 |
+
echo "=== [gemma] MedGemma_4B_IT VGMED ==="
|
| 41 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_both_random/mask_both_random_VGMED_MedGemma_4B_IT.sh
|
| 42 |
+
echo "=== [gemma] MedGemma_27B_IT COCO ==="
|
| 43 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_both_random/mask_both_random_COCO_MedGemma_27B_IT.sh
|
| 44 |
+
echo "=== [gemma] MedGemma_27B_IT VGMED ==="
|
| 45 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_both_random/mask_both_random_VGMED_MedGemma_27B_IT.sh
|
| 46 |
+
|
| 47 |
+
echo "All mask_both_random jobs finished."
|
之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_mask_region.sh
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# run_all_mask_region: grounding_mask_region.py
|
| 3 |
+
export CUDA_VISIBLE_DEVICES=0
|
| 4 |
+
cd "$(dirname "$0")/.."
|
| 5 |
+
|
| 6 |
+
echo "=== [qianwen] Qwen25VL_7B COCO ==="
|
| 7 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_region/mask_region_COCO_Qwen25VL_7B.sh
|
| 8 |
+
echo "=== [qianwen] Qwen25VL_7B VGMED ==="
|
| 9 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_region/mask_region_VGMED_Qwen25VL_7B.sh
|
| 10 |
+
echo "=== [qianwen] Qwen25VL_3B COCO ==="
|
| 11 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_region/mask_region_COCO_Qwen25VL_3B.sh
|
| 12 |
+
echo "=== [qianwen] Qwen25VL_3B VGMED ==="
|
| 13 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_region/mask_region_VGMED_Qwen25VL_3B.sh
|
| 14 |
+
echo "=== [qianwen] Qwen25VL_32B COCO ==="
|
| 15 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_region/mask_region_COCO_Qwen25VL_32B.sh
|
| 16 |
+
echo "=== [qianwen] Qwen25VL_32B VGMED ==="
|
| 17 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_region/mask_region_VGMED_Qwen25VL_32B.sh
|
| 18 |
+
echo "=== [llava-natural] LLaVA_7B COCO ==="
|
| 19 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_region/mask_region_COCO_LLaVA_7B.sh
|
| 20 |
+
echo "=== [llava-natural] LLaVA_7B VGMED ==="
|
| 21 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_region/mask_region_VGMED_LLaVA_7B.sh
|
| 22 |
+
echo "=== [llava-natural] LLaVA_13B COCO ==="
|
| 23 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_region/mask_region_COCO_LLaVA_13B.sh
|
| 24 |
+
echo "=== [llava-natural] LLaVA_13B VGMED ==="
|
| 25 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_region/mask_region_VGMED_LLaVA_13B.sh
|
| 26 |
+
echo "=== [llava-med] LLaVA_Med_7B COCO ==="
|
| 27 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/mask_region/mask_region_COCO_LLaVA_Med_7B.sh
|
| 28 |
+
echo "=== [llava-med] LLaVA_Med_7B VGMED ==="
|
| 29 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/mask_region/mask_region_VGMED_LLaVA_Med_7B.sh
|
| 30 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B COCO ==="
|
| 31 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_region/mask_region_COCO_HuatuoGPT_V_7B.sh
|
| 32 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B VGMED ==="
|
| 33 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_region/mask_region_VGMED_HuatuoGPT_V_7B.sh
|
| 34 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B COCO ==="
|
| 35 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_region/mask_region_COCO_HuatuoGPT_V_34B.sh
|
| 36 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B VGMED ==="
|
| 37 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_region/mask_region_VGMED_HuatuoGPT_V_34B.sh
|
| 38 |
+
echo "=== [gemma] MedGemma_4B_IT COCO ==="
|
| 39 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_region/mask_region_COCO_MedGemma_4B_IT.sh
|
| 40 |
+
echo "=== [gemma] MedGemma_4B_IT VGMED ==="
|
| 41 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_region/mask_region_VGMED_MedGemma_4B_IT.sh
|
| 42 |
+
echo "=== [gemma] MedGemma_27B_IT COCO ==="
|
| 43 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_region/mask_region_COCO_MedGemma_27B_IT.sh
|
| 44 |
+
echo "=== [gemma] MedGemma_27B_IT VGMED ==="
|
| 45 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_region/mask_region_VGMED_MedGemma_27B_IT.sh
|
| 46 |
+
|
| 47 |
+
echo "All mask_region jobs finished."
|
之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_mask_region_random.sh
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# run_all_mask_region_random: grounding_mask_region_random.py
|
| 3 |
+
export CUDA_VISIBLE_DEVICES=0
|
| 4 |
+
cd "$(dirname "$0")/.."
|
| 5 |
+
|
| 6 |
+
echo "=== [qianwen] Qwen25VL_7B COCO ==="
|
| 7 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_region_random/mask_region_random_COCO_Qwen25VL_7B.sh
|
| 8 |
+
echo "=== [qianwen] Qwen25VL_7B VGMED ==="
|
| 9 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_region_random/mask_region_random_VGMED_Qwen25VL_7B.sh
|
| 10 |
+
echo "=== [qianwen] Qwen25VL_3B COCO ==="
|
| 11 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_region_random/mask_region_random_COCO_Qwen25VL_3B.sh
|
| 12 |
+
echo "=== [qianwen] Qwen25VL_3B VGMED ==="
|
| 13 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_region_random/mask_region_random_VGMED_Qwen25VL_3B.sh
|
| 14 |
+
echo "=== [qianwen] Qwen25VL_32B COCO ==="
|
| 15 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_region_random/mask_region_random_COCO_Qwen25VL_32B.sh
|
| 16 |
+
echo "=== [qianwen] Qwen25VL_32B VGMED ==="
|
| 17 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_region_random/mask_region_random_VGMED_Qwen25VL_32B.sh
|
| 18 |
+
echo "=== [llava-natural] LLaVA_7B COCO ==="
|
| 19 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_region_random/mask_region_random_COCO_LLaVA_7B.sh
|
| 20 |
+
echo "=== [llava-natural] LLaVA_7B VGMED ==="
|
| 21 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_region_random/mask_region_random_VGMED_LLaVA_7B.sh
|
| 22 |
+
echo "=== [llava-natural] LLaVA_13B COCO ==="
|
| 23 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_region_random/mask_region_random_COCO_LLaVA_13B.sh
|
| 24 |
+
echo "=== [llava-natural] LLaVA_13B VGMED ==="
|
| 25 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_region_random/mask_region_random_VGMED_LLaVA_13B.sh
|
| 26 |
+
echo "=== [llava-med] LLaVA_Med_7B COCO ==="
|
| 27 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/mask_region_random/mask_region_random_COCO_LLaVA_Med_7B.sh
|
| 28 |
+
echo "=== [llava-med] LLaVA_Med_7B VGMED ==="
|
| 29 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/mask_region_random/mask_region_random_VGMED_LLaVA_Med_7B.sh
|
| 30 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B COCO ==="
|
| 31 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_region_random/mask_region_random_COCO_HuatuoGPT_V_7B.sh
|
| 32 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B VGMED ==="
|
| 33 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_region_random/mask_region_random_VGMED_HuatuoGPT_V_7B.sh
|
| 34 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B COCO ==="
|
| 35 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_region_random/mask_region_random_COCO_HuatuoGPT_V_34B.sh
|
| 36 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B VGMED ==="
|
| 37 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_region_random/mask_region_random_VGMED_HuatuoGPT_V_34B.sh
|
| 38 |
+
echo "=== [gemma] MedGemma_4B_IT COCO ==="
|
| 39 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_region_random/mask_region_random_COCO_MedGemma_4B_IT.sh
|
| 40 |
+
echo "=== [gemma] MedGemma_4B_IT VGMED ==="
|
| 41 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_region_random/mask_region_random_VGMED_MedGemma_4B_IT.sh
|
| 42 |
+
echo "=== [gemma] MedGemma_27B_IT COCO ==="
|
| 43 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_region_random/mask_region_random_COCO_MedGemma_27B_IT.sh
|
| 44 |
+
echo "=== [gemma] MedGemma_27B_IT VGMED ==="
|
| 45 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_region_random/mask_region_random_VGMED_MedGemma_27B_IT.sh
|
| 46 |
+
|
| 47 |
+
echo "All mask_region_random jobs finished."
|
之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_mask_text.sh
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# run_all_mask_text: grounding_mask_text.py
|
| 3 |
+
export CUDA_VISIBLE_DEVICES=0
|
| 4 |
+
cd "$(dirname "$0")/.."
|
| 5 |
+
|
| 6 |
+
echo "=== [qianwen] Qwen25VL_7B COCO ==="
|
| 7 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_text/mask_text_COCO_Qwen25VL_7B.sh
|
| 8 |
+
echo "=== [qianwen] Qwen25VL_7B VGMED ==="
|
| 9 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_text/mask_text_VGMED_Qwen25VL_7B.sh
|
| 10 |
+
echo "=== [qianwen] Qwen25VL_3B COCO ==="
|
| 11 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_text/mask_text_COCO_Qwen25VL_3B.sh
|
| 12 |
+
echo "=== [qianwen] Qwen25VL_3B VGMED ==="
|
| 13 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_text/mask_text_VGMED_Qwen25VL_3B.sh
|
| 14 |
+
echo "=== [qianwen] Qwen25VL_32B COCO ==="
|
| 15 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_text/mask_text_COCO_Qwen25VL_32B.sh
|
| 16 |
+
echo "=== [qianwen] Qwen25VL_32B VGMED ==="
|
| 17 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_text/mask_text_VGMED_Qwen25VL_32B.sh
|
| 18 |
+
echo "=== [llava-natural] LLaVA_7B COCO ==="
|
| 19 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_text/mask_text_COCO_LLaVA_7B.sh
|
| 20 |
+
echo "=== [llava-natural] LLaVA_7B VGMED ==="
|
| 21 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_text/mask_text_VGMED_LLaVA_7B.sh
|
| 22 |
+
echo "=== [llava-natural] LLaVA_13B COCO ==="
|
| 23 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_text/mask_text_COCO_LLaVA_13B.sh
|
| 24 |
+
echo "=== [llava-natural] LLaVA_13B VGMED ==="
|
| 25 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_text/mask_text_VGMED_LLaVA_13B.sh
|
| 26 |
+
echo "=== [llava-med] LLaVA_Med_7B COCO ==="
|
| 27 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/mask_text/mask_text_COCO_LLaVA_Med_7B.sh
|
| 28 |
+
echo "=== [llava-med] LLaVA_Med_7B VGMED ==="
|
| 29 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/mask_text/mask_text_VGMED_LLaVA_Med_7B.sh
|
| 30 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B COCO ==="
|
| 31 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_text/mask_text_COCO_HuatuoGPT_V_7B.sh
|
| 32 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B VGMED ==="
|
| 33 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_text/mask_text_VGMED_HuatuoGPT_V_7B.sh
|
| 34 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B COCO ==="
|
| 35 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_text/mask_text_COCO_HuatuoGPT_V_34B.sh
|
| 36 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B VGMED ==="
|
| 37 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_text/mask_text_VGMED_HuatuoGPT_V_34B.sh
|
| 38 |
+
echo "=== [gemma] MedGemma_4B_IT COCO ==="
|
| 39 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_text/mask_text_COCO_MedGemma_4B_IT.sh
|
| 40 |
+
echo "=== [gemma] MedGemma_4B_IT VGMED ==="
|
| 41 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_text/mask_text_VGMED_MedGemma_4B_IT.sh
|
| 42 |
+
echo "=== [gemma] MedGemma_27B_IT COCO ==="
|
| 43 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_text/mask_text_COCO_MedGemma_27B_IT.sh
|
| 44 |
+
echo "=== [gemma] MedGemma_27B_IT VGMED ==="
|
| 45 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_text/mask_text_VGMED_MedGemma_27B_IT.sh
|
| 46 |
+
|
| 47 |
+
echo "All mask_text jobs finished."
|
之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_mask_text_random.sh
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# run_all_mask_text_random: grounding_mask_text_random.py
|
| 3 |
+
export CUDA_VISIBLE_DEVICES=0
|
| 4 |
+
cd "$(dirname "$0")/.."
|
| 5 |
+
|
| 6 |
+
echo "=== [qianwen] Qwen25VL_7B COCO ==="
|
| 7 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_text_random/mask_text_random_COCO_Qwen25VL_7B.sh
|
| 8 |
+
echo "=== [qianwen] Qwen25VL_7B VGMED ==="
|
| 9 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_text_random/mask_text_random_VGMED_Qwen25VL_7B.sh
|
| 10 |
+
echo "=== [qianwen] Qwen25VL_3B COCO ==="
|
| 11 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_text_random/mask_text_random_COCO_Qwen25VL_3B.sh
|
| 12 |
+
echo "=== [qianwen] Qwen25VL_3B VGMED ==="
|
| 13 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_text_random/mask_text_random_VGMED_Qwen25VL_3B.sh
|
| 14 |
+
echo "=== [qianwen] Qwen25VL_32B COCO ==="
|
| 15 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_text_random/mask_text_random_COCO_Qwen25VL_32B.sh
|
| 16 |
+
echo "=== [qianwen] Qwen25VL_32B VGMED ==="
|
| 17 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/mask_text_random/mask_text_random_VGMED_Qwen25VL_32B.sh
|
| 18 |
+
echo "=== [llava-natural] LLaVA_7B COCO ==="
|
| 19 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_text_random/mask_text_random_COCO_LLaVA_7B.sh
|
| 20 |
+
echo "=== [llava-natural] LLaVA_7B VGMED ==="
|
| 21 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_text_random/mask_text_random_VGMED_LLaVA_7B.sh
|
| 22 |
+
echo "=== [llava-natural] LLaVA_13B COCO ==="
|
| 23 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_text_random/mask_text_random_COCO_LLaVA_13B.sh
|
| 24 |
+
echo "=== [llava-natural] LLaVA_13B VGMED ==="
|
| 25 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/mask_text_random/mask_text_random_VGMED_LLaVA_13B.sh
|
| 26 |
+
echo "=== [llava-med] LLaVA_Med_7B COCO ==="
|
| 27 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/mask_text_random/mask_text_random_COCO_LLaVA_Med_7B.sh
|
| 28 |
+
echo "=== [llava-med] LLaVA_Med_7B VGMED ==="
|
| 29 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/mask_text_random/mask_text_random_VGMED_LLaVA_Med_7B.sh
|
| 30 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B COCO ==="
|
| 31 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_text_random/mask_text_random_COCO_HuatuoGPT_V_7B.sh
|
| 32 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B VGMED ==="
|
| 33 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_text_random/mask_text_random_VGMED_HuatuoGPT_V_7B.sh
|
| 34 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B COCO ==="
|
| 35 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_text_random/mask_text_random_COCO_HuatuoGPT_V_34B.sh
|
| 36 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B VGMED ==="
|
| 37 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/mask_text_random/mask_text_random_VGMED_HuatuoGPT_V_34B.sh
|
| 38 |
+
echo "=== [gemma] MedGemma_4B_IT COCO ==="
|
| 39 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_text_random/mask_text_random_COCO_MedGemma_4B_IT.sh
|
| 40 |
+
echo "=== [gemma] MedGemma_4B_IT VGMED ==="
|
| 41 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_text_random/mask_text_random_VGMED_MedGemma_4B_IT.sh
|
| 42 |
+
echo "=== [gemma] MedGemma_27B_IT COCO ==="
|
| 43 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_text_random/mask_text_random_COCO_MedGemma_27B_IT.sh
|
| 44 |
+
echo "=== [gemma] MedGemma_27B_IT VGMED ==="
|
| 45 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/mask_text_random/mask_text_random_VGMED_MedGemma_27B_IT.sh
|
| 46 |
+
|
| 47 |
+
echo "All mask_text_random jobs finished."
|
之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_measure_attention.sh
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# GPU2: measure_attention for all models (sequential, MedGemma last)
|
| 3 |
+
# Env: qianwen -> llava-natural -> llava-med -> huatuogpt -> gemma
|
| 4 |
+
export CUDA_VISIBLE_DEVICES=0
|
| 5 |
+
cd "$(dirname "$0")/.."
|
| 6 |
+
|
| 7 |
+
echo "=== [qianwen] Qwen25VL_7B COCO ==="
|
| 8 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/measure_attention/measure_attention_COCO_Qwen25VL_7B.sh
|
| 9 |
+
echo "=== [qianwen] Qwen25VL_7B VGMED ==="
|
| 10 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/measure_attention/measure_attention_VGMED_Qwen25VL_7B.sh
|
| 11 |
+
echo "=== [qianwen] Qwen25VL_3B COCO ==="
|
| 12 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/measure_attention/measure_attention_COCO_Qwen25VL_3B.sh
|
| 13 |
+
echo "=== [qianwen] Qwen25VL_3B VGMED ==="
|
| 14 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/measure_attention/measure_attention_VGMED_Qwen25VL_3B.sh
|
| 15 |
+
echo "=== [qianwen] Qwen25VL_32B COCO ==="
|
| 16 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/measure_attention/measure_attention_COCO_Qwen25VL_32B.sh
|
| 17 |
+
echo "=== [qianwen] Qwen25VL_32B VGMED ==="
|
| 18 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/measure_attention/measure_attention_VGMED_Qwen25VL_32B.sh
|
| 19 |
+
echo "=== [llava-natural] LLaVA_7B COCO ==="
|
| 20 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/measure_attention/measure_attention_COCO_LLaVA_7B.sh
|
| 21 |
+
echo "=== [llava-natural] LLaVA_7B VGMED ==="
|
| 22 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/measure_attention/measure_attention_VGMED_LLaVA_7B.sh
|
| 23 |
+
echo "=== [llava-natural] LLaVA_13B COCO ==="
|
| 24 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/measure_attention/measure_attention_COCO_LLaVA_13B.sh
|
| 25 |
+
echo "=== [llava-natural] LLaVA_13B VGMED ==="
|
| 26 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/measure_attention/measure_attention_VGMED_LLaVA_13B.sh
|
| 27 |
+
echo "=== [llava-med] LLaVA_Med_7B COCO ==="
|
| 28 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/measure_attention/measure_attention_COCO_LLaVA_Med_7B.sh
|
| 29 |
+
echo "=== [llava-med] LLaVA_Med_7B VGMED ==="
|
| 30 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/measure_attention/measure_attention_VGMED_LLaVA_Med_7B.sh
|
| 31 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B COCO ==="
|
| 32 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/measure_attention/measure_attention_COCO_HuatuoGPT_V_7B.sh
|
| 33 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B VGMED ==="
|
| 34 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/measure_attention/measure_attention_VGMED_HuatuoGPT_V_7B.sh
|
| 35 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B COCO ==="
|
| 36 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/measure_attention/measure_attention_COCO_HuatuoGPT_V_34B.sh
|
| 37 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B VGMED ==="
|
| 38 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/measure_attention/measure_attention_VGMED_HuatuoGPT_V_34B.sh
|
| 39 |
+
echo "=== [gemma] MedGemma_4B_IT COCO ==="
|
| 40 |
+
conda run --no-capture-output -n gemma bash eval_scripts/measure_attention/measure_attention_COCO_MedGemma_4B_IT.sh
|
| 41 |
+
echo "=== [gemma] MedGemma_4B_IT VGMED ==="
|
| 42 |
+
conda run --no-capture-output -n gemma bash eval_scripts/measure_attention/measure_attention_VGMED_MedGemma_4B_IT.sh
|
| 43 |
+
echo "=== [gemma] MedGemma_27B_IT COCO ==="
|
| 44 |
+
conda run --no-capture-output -n gemma bash eval_scripts/measure_attention/measure_attention_COCO_MedGemma_27B_IT.sh
|
| 45 |
+
echo "=== [gemma] MedGemma_27B_IT VGMED ==="
|
| 46 |
+
conda run --no-capture-output -n gemma bash eval_scripts/measure_attention/measure_attention_VGMED_MedGemma_27B_IT.sh
|
| 47 |
+
|
| 48 |
+
echo "All measure_attention jobs finished."
|
之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_measure_attention_head.sh
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# GPU2: measure_attention_head for all models (sequential, MedGemma last)
|
| 3 |
+
# Env: qianwen -> llava-natural -> llava-med -> huatuogpt -> gemma
|
| 4 |
+
cd "$(dirname "$0")/.."
|
| 5 |
+
|
| 6 |
+
echo "=== [qianwen] Qwen25VL_7B COCO ==="
|
| 7 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/measure_attention_head/measure_attention_head_COCO_Qwen25VL_7B.sh
|
| 8 |
+
echo "=== [qianwen] Qwen25VL_7B VGMED ==="
|
| 9 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/measure_attention_head/measure_attention_head_VGMED_Qwen25VL_7B.sh
|
| 10 |
+
echo "=== [qianwen] Qwen25VL_3B COCO ==="
|
| 11 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/measure_attention_head/measure_attention_head_COCO_Qwen25VL_3B.sh
|
| 12 |
+
echo "=== [qianwen] Qwen25VL_3B VGMED ==="
|
| 13 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/measure_attention_head/measure_attention_head_VGMED_Qwen25VL_3B.sh
|
| 14 |
+
echo "=== [qianwen] Qwen25VL_32B COCO ==="
|
| 15 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/measure_attention_head/measure_attention_head_COCO_Qwen25VL_32B.sh
|
| 16 |
+
echo "=== [qianwen] Qwen25VL_32B VGMED ==="
|
| 17 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/measure_attention_head/measure_attention_head_VGMED_Qwen25VL_32B.sh
|
| 18 |
+
echo "=== [llava-natural] LLaVA_7B COCO ==="
|
| 19 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/measure_attention_head/measure_attention_head_COCO_LLaVA_7B.sh
|
| 20 |
+
echo "=== [llava-natural] LLaVA_7B VGMED ==="
|
| 21 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/measure_attention_head/measure_attention_head_VGMED_LLaVA_7B.sh
|
| 22 |
+
echo "=== [llava-natural] LLaVA_13B COCO ==="
|
| 23 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/measure_attention_head/measure_attention_head_COCO_LLaVA_13B.sh
|
| 24 |
+
echo "=== [llava-natural] LLaVA_13B VGMED ==="
|
| 25 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/measure_attention_head/measure_attention_head_VGMED_LLaVA_13B.sh
|
| 26 |
+
echo "=== [llava-med] LLaVA_Med_7B COCO ==="
|
| 27 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/measure_attention_head/measure_attention_head_COCO_LLaVA_Med_7B.sh
|
| 28 |
+
echo "=== [llava-med] LLaVA_Med_7B VGMED ==="
|
| 29 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/measure_attention_head/measure_attention_head_VGMED_LLaVA_Med_7B.sh
|
| 30 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B COCO ==="
|
| 31 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/measure_attention_head/measure_attention_head_COCO_HuatuoGPT_V_7B.sh
|
| 32 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B VGMED ==="
|
| 33 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/measure_attention_head/measure_attention_head_VGMED_HuatuoGPT_V_7B.sh
|
| 34 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B COCO ==="
|
| 35 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/measure_attention_head/measure_attention_head_COCO_HuatuoGPT_V_34B.sh
|
| 36 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B VGMED ==="
|
| 37 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/measure_attention_head/measure_attention_head_VGMED_HuatuoGPT_V_34B.sh
|
| 38 |
+
echo "=== [gemma] MedGemma_4B_IT COCO ==="
|
| 39 |
+
conda run --no-capture-output -n gemma bash eval_scripts/measure_attention_head/measure_attention_head_COCO_MedGemma_4B_IT.sh
|
| 40 |
+
echo "=== [gemma] MedGemma_4B_IT VGMED ==="
|
| 41 |
+
conda run --no-capture-output -n gemma bash eval_scripts/measure_attention_head/measure_attention_head_VGMED_MedGemma_4B_IT.sh
|
| 42 |
+
echo "=== [gemma] MedGemma_27B_IT COCO ==="
|
| 43 |
+
conda run --no-capture-output -n gemma bash eval_scripts/measure_attention_head/measure_attention_head_COCO_MedGemma_27B_IT.sh
|
| 44 |
+
echo "=== [gemma] MedGemma_27B_IT VGMED ==="
|
| 45 |
+
conda run --no-capture-output -n gemma bash eval_scripts/measure_attention_head/measure_attention_head_VGMED_MedGemma_27B_IT.sh
|
| 46 |
+
|
| 47 |
+
echo "All measure_attention_head jobs finished."
|
之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/eval_scripts/run_all_text_only.sh
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# run_all_text_only: grounding_text_only.py
|
| 3 |
+
export CUDA_VISIBLE_DEVICES=0
|
| 4 |
+
cd "$(dirname "$0")/.."
|
| 5 |
+
|
| 6 |
+
echo "=== [qianwen] Qwen25VL_7B COCO ==="
|
| 7 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/text_only/text_only_COCO_Qwen25VL_7B.sh
|
| 8 |
+
echo "=== [qianwen] Qwen25VL_7B VGMED ==="
|
| 9 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/text_only/text_only_VGMED_Qwen25VL_7B.sh
|
| 10 |
+
echo "=== [qianwen] Qwen25VL_3B COCO ==="
|
| 11 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/text_only/text_only_COCO_Qwen25VL_3B.sh
|
| 12 |
+
echo "=== [qianwen] Qwen25VL_3B VGMED ==="
|
| 13 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/text_only/text_only_VGMED_Qwen25VL_3B.sh
|
| 14 |
+
echo "=== [qianwen] Qwen25VL_32B COCO ==="
|
| 15 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/text_only/text_only_COCO_Qwen25VL_32B.sh
|
| 16 |
+
echo "=== [qianwen] Qwen25VL_32B VGMED ==="
|
| 17 |
+
conda run --no-capture-output -n qianwen bash eval_scripts/grounding/text_only/text_only_VGMED_Qwen25VL_32B.sh
|
| 18 |
+
echo "=== [llava-natural] LLaVA_7B COCO ==="
|
| 19 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/text_only/text_only_COCO_LLaVA_7B.sh
|
| 20 |
+
echo "=== [llava-natural] LLaVA_7B VGMED ==="
|
| 21 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/text_only/text_only_VGMED_LLaVA_7B.sh
|
| 22 |
+
echo "=== [llava-natural] LLaVA_13B COCO ==="
|
| 23 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/text_only/text_only_COCO_LLaVA_13B.sh
|
| 24 |
+
echo "=== [llava-natural] LLaVA_13B VGMED ==="
|
| 25 |
+
conda run --no-capture-output -n llava-natural bash eval_scripts/grounding/text_only/text_only_VGMED_LLaVA_13B.sh
|
| 26 |
+
echo "=== [llava-med] LLaVA_Med_7B COCO ==="
|
| 27 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/text_only/text_only_COCO_LLaVA_Med_7B.sh
|
| 28 |
+
echo "=== [llava-med] LLaVA_Med_7B VGMED ==="
|
| 29 |
+
conda run --no-capture-output -n llava-med bash eval_scripts/grounding/text_only/text_only_VGMED_LLaVA_Med_7B.sh
|
| 30 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B COCO ==="
|
| 31 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/text_only/text_only_COCO_HuatuoGPT_V_7B.sh
|
| 32 |
+
echo "=== [huatuogpt] HuatuoGPT_V_7B VGMED ==="
|
| 33 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/text_only/text_only_VGMED_HuatuoGPT_V_7B.sh
|
| 34 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B COCO ==="
|
| 35 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/text_only/text_only_COCO_HuatuoGPT_V_34B.sh
|
| 36 |
+
echo "=== [huatuogpt] HuatuoGPT_V_34B VGMED ==="
|
| 37 |
+
conda run --no-capture-output -n huatuogpt bash eval_scripts/grounding/text_only/text_only_VGMED_HuatuoGPT_V_34B.sh
|
| 38 |
+
echo "=== [gemma] MedGemma_4B_IT COCO ==="
|
| 39 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/text_only/text_only_COCO_MedGemma_4B_IT.sh
|
| 40 |
+
echo "=== [gemma] MedGemma_4B_IT VGMED ==="
|
| 41 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/text_only/text_only_VGMED_MedGemma_4B_IT.sh
|
| 42 |
+
echo "=== [gemma] MedGemma_27B_IT COCO ==="
|
| 43 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/text_only/text_only_COCO_MedGemma_27B_IT.sh
|
| 44 |
+
echo "=== [gemma] MedGemma_27B_IT VGMED ==="
|
| 45 |
+
conda run --no-capture-output -n gemma bash eval_scripts/grounding/text_only/text_only_VGMED_MedGemma_27B_IT.sh
|
| 46 |
+
|
| 47 |
+
echo "All text_only jobs finished."
|
之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/models/HealthGPT/.ipynb_checkpoints/HealthGPT-checkpoint.py
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os, sys
|
| 2 |
+
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
|
| 3 |
+
import torch
|
| 4 |
+
import transformers
|
| 5 |
+
import tokenizers
|
| 6 |
+
|
| 7 |
+
from PIL import Image
|
| 8 |
+
from tqdm import tqdm
|
| 9 |
+
from packaging import version
|
| 10 |
+
IS_TOKENIZER_GREATER_THAN_0_14 = version.parse(tokenizers.__version__) >= version.parse('0.14')
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
from .llava import conversation as conversation_lib
|
| 14 |
+
from .llava.model import *
|
| 15 |
+
from .llava.mm_utils import tokenizer_image_token,process_images
|
| 16 |
+
from .llava.model.language_model.llava_phi3 import LlavaPhiForCausalLM, LlavaPhiConfig
|
| 17 |
+
|
| 18 |
+
from .utils import find_all_linear_names, add_special_tokens_and_resize_model, load_weights, expand2square,com_vision_args
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
class HealthGPT:
|
| 22 |
+
def __init__(self,model_path,args):
|
| 23 |
+
super().__init__()
|
| 24 |
+
self.llm = LlavaQwen2ForCausalLM.from_pretrained(
|
| 25 |
+
pretrained_model_name_or_path = model_path,
|
| 26 |
+
attn_implementation="flash_attention_2",
|
| 27 |
+
torch_dtype= torch.float16,
|
| 28 |
+
device_map="cuda"
|
| 29 |
+
)
|
| 30 |
+
from .llava.peft import LoraConfig, get_peft_model
|
| 31 |
+
print("load model done")
|
| 32 |
+
lora_config = LoraConfig(
|
| 33 |
+
r= 32,
|
| 34 |
+
lora_alpha=64,
|
| 35 |
+
target_modules=find_all_linear_names(self.llm),
|
| 36 |
+
lora_dropout=0.0,
|
| 37 |
+
bias='none',
|
| 38 |
+
task_type="CAUSAL_LM",
|
| 39 |
+
lora_nums=4,
|
| 40 |
+
)
|
| 41 |
+
self.llm = get_peft_model(self.llm, lora_config)
|
| 42 |
+
print("load lora done")
|
| 43 |
+
|
| 44 |
+
self.tokenizer = transformers.AutoTokenizer.from_pretrained(
|
| 45 |
+
model_path,
|
| 46 |
+
padding_side="right",
|
| 47 |
+
use_fast=False,
|
| 48 |
+
)
|
| 49 |
+
if self.tokenizer.unk_token:
|
| 50 |
+
self.tokenizer.pad_token = tokenizer.unk_token
|
| 51 |
+
else:
|
| 52 |
+
self.tokenizer.legacy = False
|
| 53 |
+
print("load tokenizer done")
|
| 54 |
+
|
| 55 |
+
from .utils import com_vision_args
|
| 56 |
+
com_vision_args.model_name_or_path = model_path
|
| 57 |
+
com_vision_args.vision_tower = '/mnt/workspace/workgroup_dev/longli/models/hub/clip-vit-large-patch14-336'
|
| 58 |
+
com_vision_args.version = "qwen_2"
|
| 59 |
+
|
| 60 |
+
self.llm.get_model().initialize_vision_modules(model_args=com_vision_args)
|
| 61 |
+
self.llm.get_vision_tower().to(dtype=torch.float16)
|
| 62 |
+
self.llm.get_model().mm_projector.to(dtype=torch.float16)
|
| 63 |
+
print("load vision tower done")
|
| 64 |
+
|
| 65 |
+
self.llm = load_weights(self.llm, "/mnt/workspace/workgroup_dev/longli/models/hub/HealthGPT-XL32/com_hlora_weights_QWEN_32B.bin")
|
| 66 |
+
print("load weights done")
|
| 67 |
+
self.llm.eval()
|
| 68 |
+
self.llm.to(dtype=torch.float16).cuda()
|
| 69 |
+
|
| 70 |
+
self.temperature = args.temperature
|
| 71 |
+
self.top_p = args.top_p
|
| 72 |
+
self.repetition_penalty = args.repetition_penalty
|
| 73 |
+
self.max_tokens = args.max_new_tokens
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
def process_messages(self,messages):
|
| 77 |
+
conv = conversation_lib.conv_templates["qwen_2"].copy()
|
| 78 |
+
conv.messages = []
|
| 79 |
+
if "system" in messages:
|
| 80 |
+
conv.system = messages["system"]
|
| 81 |
+
|
| 82 |
+
imgs = []
|
| 83 |
+
if "image" in messages:
|
| 84 |
+
image = messages["image"]
|
| 85 |
+
if isinstance(image,str):
|
| 86 |
+
image = Image.open(image).convert('RGB')
|
| 87 |
+
elif isinstance(image,Image.Image):
|
| 88 |
+
image = image.convert('RGB')
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
imgs.append(image)
|
| 92 |
+
prompt = DEFAULT_IMAGE_TOKEN + '\n' + messages["prompt"]
|
| 93 |
+
elif "images" in messages:
|
| 94 |
+
images = messages["images"]
|
| 95 |
+
prompt = ""
|
| 96 |
+
for i,image in enumerate(images):
|
| 97 |
+
prompt += f"<image_{i+1}>: " + DEFAULT_IMAGE_TOKEN + '\n'
|
| 98 |
+
if isinstance(image,str):
|
| 99 |
+
if os.path.exists(image):
|
| 100 |
+
image = Image.open(image)
|
| 101 |
+
elif isinstance(image,Image.Image):
|
| 102 |
+
image = image.convert("RGB")
|
| 103 |
+
imgs.append(image)
|
| 104 |
+
prompt += messages["prompt"]
|
| 105 |
+
else:
|
| 106 |
+
prompt = messages["prompt"]
|
| 107 |
+
conv.append_message(conv.roles[0],prompt)
|
| 108 |
+
conv.append_message(conv.roles[1],None)
|
| 109 |
+
prompt = conv.get_prompt()
|
| 110 |
+
imgs = None if len(imgs) == 0 else imgs
|
| 111 |
+
return prompt,imgs
|
| 112 |
+
|
| 113 |
+
|
| 114 |
+
def generate_output(self,messages):
|
| 115 |
+
prompt,imgs = self.process_messages(messages)
|
| 116 |
+
if imgs:
|
| 117 |
+
# imgs = imgs[0]
|
| 118 |
+
input_ids = tokenizer_image_token(prompt, self.tokenizer, IMAGE_TOKEN_INDEX, return_tensors='pt').unsqueeze_(0).cuda()
|
| 119 |
+
imgs = [expand2square(img, tuple(int(x*255) for x in self.llm.get_vision_tower().image_processor.image_mean)) for img in imgs]
|
| 120 |
+
imgs = self.llm.get_vision_tower().image_processor.preprocess(imgs, return_tensors='pt')['pixel_values'].to(dtype=torch.float16, device='cuda', non_blocking=True)
|
| 121 |
+
# imgs = process_images(imgs,self.llm.get_vision_tower().image_processor,self.llm.config)
|
| 122 |
+
else:
|
| 123 |
+
input_ids = tokenizer_image_token(prompt, self.tokenizer, IMAGE_TOKEN_INDEX, return_tensors='pt').unsqueeze_(0).cuda()
|
| 124 |
+
imgs = None
|
| 125 |
+
|
| 126 |
+
with torch.inference_mode():
|
| 127 |
+
do_sample = False if self.temperature == 0 else True
|
| 128 |
+
output_ids = self.llm.base_model.model.generate(input_ids,images=imgs,do_sample=do_sample,num_beams=5,max_new_tokens=self.max_tokens,temperature = self.temperature,top_p = self.top_p,repetition_penalty = self.repetition_penalty,use_cache=True)
|
| 129 |
+
|
| 130 |
+
outputs = self.tokenizer.batch_decode(output_ids, skip_special_tokens=True)[0].strip()
|
| 131 |
+
return outputs
|
| 132 |
+
|
| 133 |
+
def generate_outputs(self,messages_list):
|
| 134 |
+
outputs = []
|
| 135 |
+
for messages in tqdm(messages_list):
|
| 136 |
+
output = self.generate_output(messages)
|
| 137 |
+
outputs.append(output)
|
| 138 |
+
return outputs
|
| 139 |
+
|
| 140 |
+
if __name__ == '__main__':
|
| 141 |
+
# def construct_messages(sample):
|
| 142 |
+
# question = sample["question"]
|
| 143 |
+
# image = sample["image"]
|
| 144 |
+
# answer = sample["answer"]
|
| 145 |
+
# if answer in ["yes","no"]:
|
| 146 |
+
# question += "Please output 'yes' or 'no'(no extra output)"
|
| 147 |
+
# if os.environ.get("STRICT_PROMPT","False") == "True":
|
| 148 |
+
# question += "Wrap your final answer between <answer> and </answer>, for example: <answer>yes</answer>"
|
| 149 |
+
# else:
|
| 150 |
+
# question += 'Answer the question concisely(Keep it short and concise).'
|
| 151 |
+
# if os.environ.get("STRICT_PROMPT","False") == "True":
|
| 152 |
+
# question += "Wrap your final answer between <answer> and </answer>, for example: <answer>positive influence</answer>"
|
| 153 |
+
# messages = {"prompt":question,"image":image}
|
| 154 |
+
# sample["messages"] = messages
|
| 155 |
+
# return sample
|
| 156 |
+
|
| 157 |
+
# from datasets import load_dataset
|
| 158 |
+
# from tqdm import tqdm
|
| 159 |
+
# dataset = load_dataset("/mnt/workspace/workgroup_dev/longli/MedLLMBenchmarks/benchmarks/VQA_RAD",split="test")
|
| 160 |
+
|
| 161 |
+
# llm = HealthGPT()
|
| 162 |
+
# for data in tqdm(dataset):
|
| 163 |
+
# data = construct_messages(data)
|
| 164 |
+
# image = data["image"]
|
| 165 |
+
# messages = {"prompt":data["question"],"image":image}
|
| 166 |
+
# result = llm.generate_output(messages)
|
| 167 |
+
|
| 168 |
+
llm = HealthGPT()
|
| 169 |
+
image = "/mnt/workspace/workgroup_dev/longli/MedLLMBenchmarks/benchmarks/OmniMedVQA/Images/ACRIMA/Im553_g_ACRIMA.png"
|
| 170 |
+
image2 = "/mnt/workspace/workgroup_dev/longli/MedLLMBenchmarks/benchmarks/OmniMedVQA/Images/BreakHis/benign/SOB_B_A-14-22549AB-40-005.png"
|
| 171 |
+
messages = [{ 'images': [image,image2],"prompt":"\nQuestion: 你是一个医疗助手,我的问题是这两张图片里的内容是什么?"}]
|
| 172 |
+
result = llm.generate_outputs(messages)
|
| 173 |
+
print("result:",result)
|
之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/models/HealthGPT/.ipynb_checkpoints/HealthGPT_phi-checkpoint.py
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os, sys
|
| 2 |
+
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
|
| 3 |
+
import torch
|
| 4 |
+
import transformers
|
| 5 |
+
import tokenizers
|
| 6 |
+
|
| 7 |
+
from PIL import Image
|
| 8 |
+
from tqdm import tqdm
|
| 9 |
+
from packaging import version
|
| 10 |
+
IS_TOKENIZER_GREATER_THAN_0_14 = version.parse(tokenizers.__version__) >= version.parse('0.14')
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
from .llava.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN
|
| 14 |
+
from .llava.peft import LoraConfig, get_peft_model
|
| 15 |
+
from .llava import conversation as conversation_lib
|
| 16 |
+
from .llava.model import *
|
| 17 |
+
from .llava.mm_utils import tokenizer_image_token,process_images
|
| 18 |
+
from .llava.model.language_model.llava_phi3 import LlavaPhiForCausalLM
|
| 19 |
+
from .utils import find_all_linear_names, add_special_tokens_and_resize_model, load_weights, expand2square,com_vision_args
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
class HealthGPT:
|
| 23 |
+
def __init__(self,model_path,args):
|
| 24 |
+
super().__init__()
|
| 25 |
+
self.llm = LlavaPhiForCausalLM.from_pretrained(
|
| 26 |
+
pretrained_model_name_or_path = model_path,
|
| 27 |
+
attn_implementation="flash_attention_2",
|
| 28 |
+
torch_dtype= torch.float16,
|
| 29 |
+
device_map="cuda"
|
| 30 |
+
)
|
| 31 |
+
print("load model done")
|
| 32 |
+
lora_config = LoraConfig(
|
| 33 |
+
r= 32,
|
| 34 |
+
lora_alpha=64,
|
| 35 |
+
target_modules=find_all_linear_names(self.llm),
|
| 36 |
+
lora_dropout=0.0,
|
| 37 |
+
bias='none',
|
| 38 |
+
task_type="CAUSAL_LM",
|
| 39 |
+
lora_nums=4,
|
| 40 |
+
)
|
| 41 |
+
self.llm = get_peft_model(self.llm, lora_config)
|
| 42 |
+
print("load lora done")
|
| 43 |
+
|
| 44 |
+
self.tokenizer = transformers.AutoTokenizer.from_pretrained(
|
| 45 |
+
model_path,
|
| 46 |
+
padding_side="right",
|
| 47 |
+
use_fast=False,
|
| 48 |
+
)
|
| 49 |
+
print("load tokenizer done")
|
| 50 |
+
|
| 51 |
+
num_new_tokens = add_special_tokens_and_resize_model(self.tokenizer, self.llm, 8192)
|
| 52 |
+
print(f"Number of new tokens added for unified task: {num_new_tokens}")
|
| 53 |
+
|
| 54 |
+
com_vision_args.model_name_or_path = model_path
|
| 55 |
+
com_vision_args.vision_tower = '/mnt/workspace/workgroup_dev/longli/models/hub/clip-vit-large-patch14-336'
|
| 56 |
+
com_vision_args.version = "phi4_instruct"
|
| 57 |
+
|
| 58 |
+
self.llm.get_model().initialize_vision_modules(model_args=com_vision_args)
|
| 59 |
+
self.llm.get_vision_tower().to(dtype=torch.float16)
|
| 60 |
+
self.llm.get_model().mm_projector.to(dtype=torch.float16)
|
| 61 |
+
print("load vision tower done")
|
| 62 |
+
|
| 63 |
+
self.llm = load_weights(self.llm, "/mnt/workspace/workgroup_dev/longli/models/hub/HealthGPT-L14/com_hlora_weights_phi4.bin")
|
| 64 |
+
print("load weights done")
|
| 65 |
+
self.llm.eval()
|
| 66 |
+
self.llm.to(dtype=torch.float16).cuda()
|
| 67 |
+
|
| 68 |
+
self.temperature = args.temperature
|
| 69 |
+
self.top_p = args.top_p
|
| 70 |
+
self.repetition_penalty = args.repetition_penalty
|
| 71 |
+
self.max_tokens = args.max_new_tokens
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
def process_messages(self,messages):
|
| 75 |
+
conv = conversation_lib.conv_templates["phi4_instruct"].copy()
|
| 76 |
+
conv.messages = []
|
| 77 |
+
if "system" in messages:
|
| 78 |
+
conv.system = messages["system"]
|
| 79 |
+
|
| 80 |
+
imgs = []
|
| 81 |
+
if "image" in messages:
|
| 82 |
+
image = messages["image"]
|
| 83 |
+
if isinstance(image,str):
|
| 84 |
+
image = Image.open(image).convert('RGB')
|
| 85 |
+
elif isinstance(image,Image.Image):
|
| 86 |
+
image = image.convert('RGB')
|
| 87 |
+
imgs.append(image)
|
| 88 |
+
prompt = DEFAULT_IMAGE_TOKEN + '\n' + messages["prompt"]
|
| 89 |
+
elif "images" in messages:
|
| 90 |
+
images = messages["images"]
|
| 91 |
+
prompt = ""
|
| 92 |
+
for i,image in enumerate(images):
|
| 93 |
+
prompt += f"<image_{i+1}>: " + DEFAULT_IMAGE_TOKEN + '\n'
|
| 94 |
+
if isinstance(image,str):
|
| 95 |
+
if os.path.exists(image):
|
| 96 |
+
image = Image.open(image)
|
| 97 |
+
elif isinstance(image,Image.Image):
|
| 98 |
+
image = image.convert("RGB")
|
| 99 |
+
imgs.append(image)
|
| 100 |
+
prompt += messages["prompt"]
|
| 101 |
+
else:
|
| 102 |
+
prompt = messages["prompt"]
|
| 103 |
+
conv.append_message(conv.roles[0],prompt)
|
| 104 |
+
conv.append_message(conv.roles[1],None)
|
| 105 |
+
prompt = conv.get_prompt()
|
| 106 |
+
imgs = None if len(imgs) == 0 else imgs
|
| 107 |
+
return prompt,imgs
|
| 108 |
+
|
| 109 |
+
|
| 110 |
+
def generate_output(self,messages):
|
| 111 |
+
prompt,imgs = self.process_messages(messages)
|
| 112 |
+
if imgs:
|
| 113 |
+
# imgs = imgs[0]
|
| 114 |
+
input_ids = tokenizer_image_token(prompt, self.tokenizer, IMAGE_TOKEN_INDEX, return_tensors='pt').unsqueeze_(0).cuda()
|
| 115 |
+
imgs = [expand2square(img, tuple(int(x*255) for x in self.llm.get_vision_tower().image_processor.image_mean)) for img in imgs]
|
| 116 |
+
imgs = self.llm.get_vision_tower().image_processor.preprocess(imgs, return_tensors='pt')['pixel_values'].to(dtype=torch.float16, device='cuda', non_blocking=True)
|
| 117 |
+
# imgs = process_images(imgs,self.llm.get_vision_tower().image_processor,self.llm.config)
|
| 118 |
+
else:
|
| 119 |
+
input_ids = tokenizer_image_token(prompt, self.tokenizer, IMAGE_TOKEN_INDEX, return_tensors='pt').unsqueeze_(0).cuda()
|
| 120 |
+
imgs = None
|
| 121 |
+
|
| 122 |
+
with torch.inference_mode():
|
| 123 |
+
do_sample = False if self.temperature == 0 else True
|
| 124 |
+
output_ids = self.llm.base_model.model.generate(input_ids,images=imgs,do_sample=do_sample,num_beams=5,max_new_tokens=self.max_tokens,temperature = self.temperature,top_p = self.top_p,repetition_penalty = self.repetition_penalty,use_cache=True)
|
| 125 |
+
|
| 126 |
+
outputs = self.tokenizer.batch_decode(output_ids, skip_special_tokens=True)[0].strip()
|
| 127 |
+
return outputs
|
| 128 |
+
|
| 129 |
+
def generate_outputs(self,messages_list):
|
| 130 |
+
outputs = []
|
| 131 |
+
for messages in tqdm(messages_list):
|
| 132 |
+
output = self.generate_output(messages)
|
| 133 |
+
outputs.append(output)
|
| 134 |
+
return outputs
|
| 135 |
+
|
| 136 |
+
if __name__ == '__main__':
|
| 137 |
+
# def construct_messages(sample):
|
| 138 |
+
# question = sample["question"]
|
| 139 |
+
# image = sample["image"]
|
| 140 |
+
# answer = sample["answer"]
|
| 141 |
+
# if answer in ["yes","no"]:
|
| 142 |
+
# question += "Please output 'yes' or 'no'(no extra output)"
|
| 143 |
+
# if os.environ.get("STRICT_PROMPT","False") == "True":
|
| 144 |
+
# question += "Wrap your final answer between <answer> and </answer>, for example: <answer>yes</answer>"
|
| 145 |
+
# else:
|
| 146 |
+
# question += 'Answer the question concisely(Keep it short and concise).'
|
| 147 |
+
# if os.environ.get("STRICT_PROMPT","False") == "True":
|
| 148 |
+
# question += "Wrap your final answer between <answer> and </answer>, for example: <answer>positive influence</answer>"
|
| 149 |
+
# messages = {"prompt":question,"image":image}
|
| 150 |
+
# sample["messages"] = messages
|
| 151 |
+
# return sample
|
| 152 |
+
|
| 153 |
+
# from datasets import load_dataset
|
| 154 |
+
# from tqdm import tqdm
|
| 155 |
+
# dataset = load_dataset("/mnt/workspace/workgroup_dev/longli/MedLLMBenchmarks/benchmarks/VQA_RAD",split="test")
|
| 156 |
+
|
| 157 |
+
# llm = HealthGPT()
|
| 158 |
+
# for data in tqdm(dataset):
|
| 159 |
+
# data = construct_messages(data)
|
| 160 |
+
# image = data["image"]
|
| 161 |
+
# messages = {"prompt":data["question"],"image":image}
|
| 162 |
+
# result = llm.generate_output(messages)
|
| 163 |
+
|
| 164 |
+
llm = HealthGPT()
|
| 165 |
+
image = "/mnt/workspace/workgroup_dev/longli/MedLLMBenchmarks/benchmarks/OmniMedVQA/Images/ACRIMA/Im553_g_ACRIMA.png"
|
| 166 |
+
image2 = "/mnt/workspace/workgroup_dev/longli/MedLLMBenchmarks/benchmarks/OmniMedVQA/Images/BreakHis/benign/SOB_B_A-14-22549AB-40-005.png"
|
| 167 |
+
messages = [{ 'images': [image,image2],"prompt":"\nQuestion: 你是一个医疗助手,我的问题是这两张图片里的内容是什么?"}]
|
| 168 |
+
result = llm.generate_outputs(messages)
|
| 169 |
+
print("result:",result)
|
之前的代码版本/第一版-全部代码/MedEvalKit-v1-v1-fullcode/models/HealthGPT/llava/demo/com_infer_phi4.sh
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
MODEL_NAME_OR_PATH="microsoft/Phi-4"
|
| 4 |
+
VIT_PATH="openai/clip-vit-large-patch14-336/"
|
| 5 |
+
HLORA_PATH="com_hlora_weights_phi4.bin"
|
| 6 |
+
|
| 7 |
+
python3 com_infer_phi4.py \
|
| 8 |
+
--model_name_or_path "$MODEL_NAME_OR_PATH" \
|
| 9 |
+
--dtype "FP16" \
|
| 10 |
+
--hlora_r "32" \
|
| 11 |
+
--hlora_alpha "64" \
|
| 12 |
+
--hlora_nums "4" \
|
| 13 |
+
--vq_idx_nums "8192" \
|
| 14 |
+
--instruct_template "phi4_instruct" \
|
| 15 |
+
--vit_path "$VIT_PATH" \
|
| 16 |
+
--hlora_path "$HLORA_PATH" \
|
| 17 |
+
--question "Your question" \
|
| 18 |
+
--img_path "path/to/image.jpg"
|