-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun_mmgdinob_eval_cdmixed.sh
More file actions
111 lines (75 loc) · 4 KB
/
run_mmgdinob_eval_cdmixed.sh
File metadata and controls
111 lines (75 loc) · 4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
export NCCL_P2P_DISABLE=1
export NCCL_IB_DISABLE=1
CONFIG_DIR="configs_cdfsod/final_configs_cdmixed"
CKPT_DIR="exp_cdfosd_results"
RESULT_OUTPUT_DIR="exp_cdfosd_results_cdmixed"
# Ensure output directories exist
mkdir -p "${CKPT_DIR}"
mkdir -p "${RESULT_OUTPUT_DIR}"
# Loop over all config files
for config_file in "${CONFIG_DIR}"/grounding_dino_swin-l_finetune_*.py; do
if [ -f "${config_file}" ] && [[ "$(basename "${config_file}")" == *"_1shot.py" ]]; then
# Extract dataset name from config filename
dataset_name=$(basename "${config_file}" | sed 's/grounding_dino_swin-l_finetune_//' | sed 's/\.py$//')
# Build output directory path
work_dir="${CKPT_DIR}/swinB_all_${dataset_name}"
echo "Processing dataset: ${dataset_name}"
echo "Config file: ${config_file}"
echo "Output directory: ${work_dir}"
work_dir_test="${RESULT_OUTPUT_DIR}/swinB_all_${dataset_name}"
# Build checkpoint directory path
ckpt_dir="${CKPT_DIR}/swinB_all_${dataset_name}"
# Find the best checkpoint file
ckpt_path=$(find "${ckpt_dir}" -name "best_coco_bbox_mAP_iter_*.pth" | head -n 1)
export NCCL_P2P_DISABLE=1
export NCCL_IB_DISABLE=1
./tools/dist_test.sh "${config_file}" "${ckpt_path}" 6 1204 "4,5,8,6,7,9" --work-dir "${work_dir_test}" --out "${work_dir_test}/${dataset_name}.pkl"
echo "Finished processing ${dataset_name}"
echo "----------------------------------------"
fi
done
# Loop over all config files
for config_file in "${CONFIG_DIR}"/grounding_dino_swin-l_finetune_*.py; do
if [ -f "${config_file}" ] && [[ "$(basename "${config_file}")" == *"_10shot.py" ]]; then
# Extract dataset name from config filename
dataset_name=$(basename "${config_file}" | sed 's/grounding_dino_swin-l_finetune_//' | sed 's/\.py$//')
# Build output directory path
work_dir="${CKPT_DIR}/swinB_all_${dataset_name}"
echo "Processing dataset: ${dataset_name}"
echo "Config file: ${config_file}"
echo "Output directory: ${work_dir}"
work_dir_test="${RESULT_OUTPUT_DIR}/swinB_all_${dataset_name}"
# Build checkpoint directory path
ckpt_dir="${CKPT_DIR}/swinB_all_${dataset_name}"
# Find the best checkpoint file
ckpt_path=$(find "${ckpt_dir}" -name "best_coco_bbox_mAP_iter_*.pth" | head -n 1)
export NCCL_P2P_DISABLE=1
export NCCL_IB_DISABLE=1
./tools/dist_test.sh "${config_file}" "${ckpt_path}" 6 1204 "4,5,8,6,7,9" --work-dir "${work_dir_test}" --out "${work_dir_test}/${dataset_name}.pkl"
echo "Finished processing ${dataset_name}"
echo "----------------------------------------"
fi
done
# Loop over all config files
for config_file in "${CONFIG_DIR}"/grounding_dino_swin-l_finetune_*.py; do
if [ -f "${config_file}" ] && [[ "$(basename "${config_file}")" == *"_5shot.py" ]]; then
# Extract dataset name from config filename
dataset_name=$(basename "${config_file}" | sed 's/grounding_dino_swin-l_finetune_//' | sed 's/\.py$//')
# Build output directory path
work_dir="${CKPT_DIR}/swinB_all_${dataset_name}"
echo "Processing dataset: ${dataset_name}"
echo "Config file: ${config_file}"
echo "Output directory: ${work_dir}"
work_dir_test="${RESULT_OUTPUT_DIR}/swinB_all_${dataset_name}"
# Build checkpoint directory path
ckpt_dir="${CKPT_DIR}/swinB_all_${dataset_name}"
# Find the best checkpoint file
ckpt_path=$(find "${ckpt_dir}" -name "best_coco_bbox_mAP_iter_*.pth" | head -n 1)
export NCCL_P2P_DISABLE=1
export NCCL_IB_DISABLE=1
./tools/dist_test.sh "${config_file}" "${ckpt_path}" 4 1204 "4,5,8,9" --work-dir "${work_dir_test}" --out "${work_dir_test}/${dataset_name}.pkl"
echo "Finished processing ${dataset_name}"
echo "----------------------------------------"
fi
done