-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrun_mmgdinob_traineval_cdfsod.sh
More file actions
105 lines (70 loc) · 3.9 KB
/
Copy pathrun_mmgdinob_traineval_cdfsod.sh
File metadata and controls
105 lines (70 loc) · 3.9 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
104
105
#!/bin/bash
export NCCL_P2P_DISABLE=1
export NCCL_IB_DISABLE=1
CONFIG_DIR="configs_cdfsod/final_configs_bs4"
CKPT_DIR="exp_cdfosd_results/"
RESULT_OUTPUT_DIR="exp_cdfosd_results/"
GPUID="4" # Set this to the GPU ID you want to use (e.g., "0", "1", "2", "3", etc.)
PORT="9999"
mkdir -p "${CKPT_DIR}"
mkdir -p "${RESULT_OUTPUT_DIR}"
for config_file in "${CONFIG_DIR}"/grounding_dino_swin-b_finetune_*.py; do
if [ -f "${config_file}" ] && [[ "$(basename "${config_file}")" == *"_1shot.py" ]]; then
dataset_name=$(basename "${config_file}" | sed 's/grounding_dino_swin-b_finetune_//' | sed 's/\.py$//')
work_dir="${CKPT_DIR}/swinB_all_${dataset_name}"
echo "Processing dataset: ${dataset_name}"
echo "Config file: ${config_file}"
echo "Output directory: ${work_dir}"
export NCCL_P2P_DISABLE=1
export NCCL_IB_DISABLE=1
./tools/dist_train.sh "${config_file}" 1 $PORT $GPUID --work-dir "${work_dir}"
work_dir_test="${RESULT_OUTPUT_DIR}/swinB_all_${dataset_name}"
ckpt_dir="${CKPT_DIR}/swinB_all_${dataset_name}"
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}" 1 $PORT $GPUID --work-dir "${work_dir_test}" --out "${work_dir_test}/${dataset_name}.pkl"
echo "Finished processing ${dataset_name}"
echo "----------------------------------------"
fi
done
for config_file in "${CONFIG_DIR}"/grounding_dino_swin-b_finetune_*.py; do
if [ -f "${config_file}" ] && [[ "$(basename "${config_file}")" == *"_5shot.py" ]]; then
dataset_name=$(basename "${config_file}" | sed 's/grounding_dino_swin-b_finetune_//' | sed 's/\.py$//')
work_dir="${CKPT_DIR}/swinB_all_${dataset_name}"
echo "Processing dataset: ${dataset_name}"
echo "Config file: ${config_file}"
echo "Output directory: ${work_dir}"
export NCCL_P2P_DISABLE=1
export NCCL_IB_DISABLE=1
./tools/dist_train.sh "${config_file}" 1 $PORT $GPUID --work-dir "${work_dir}"
work_dir_test="${RESULT_OUTPUT_DIR}/swinB_all_${dataset_name}"
ckpt_dir="${CKPT_DIR}/swinB_all_${dataset_name}"
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}" 1 $PORT $GPUID --work-dir "${work_dir_test}" --out "${work_dir_test}/${dataset_name}.pkl"
echo "Finished processing ${dataset_name}"
echo "----------------------------------------"
fi
done
for config_file in "${CONFIG_DIR}"/grounding_dino_swin-b_finetune_*.py; do
if [ -f "${config_file}" ] && [[ "$(basename "${config_file}")" == *"_10shot.py" ]]; then
dataset_name=$(basename "${config_file}" | sed 's/grounding_dino_swin-b_finetune_//' | sed 's/\.py$//')
work_dir="${CKPT_DIR}/swinB_all_${dataset_name}"
echo "Processing dataset: ${dataset_name}"
echo "Config file: ${config_file}"
echo "Output directory: ${work_dir}"
export NCCL_P2P_DISABLE=1
export NCCL_IB_DISABLE=1
./tools/dist_train.sh "${config_file}" 1 $PORT $GPUID --work-dir "${work_dir}"
work_dir_test="${RESULT_OUTPUT_DIR}/swinB_all_${dataset_name}"
ckpt_dir="${CKPT_DIR}/swinB_all_${dataset_name}"
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}" 1 $PORT $GPUID --work-dir "${work_dir_test}" --out "${work_dir_test}/${dataset_name}.pkl"
echo "Finished processing ${dataset_name}"
echo "----------------------------------------"
fi
done