-
Notifications
You must be signed in to change notification settings - Fork 4
/
eval_QV_scratch.sh
executable file
·89 lines (80 loc) · 1.95 KB
/
eval_QV_scratch.sh
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
export CUDA_VISIBLE_DEVICES=7
export CUDA_LAUNCH_BLOCKING=1
dset_name=hl
ctx_mode=video_tef
v_feat_types=slowfast_clip
t_feat_type=clip
results_root=path_to_save/qvhighlights_results
device=1
enc_layers=3
dec_layers=3
query_num=30
n_txt_mu=5
n_visual_mu=30
span_loss_type=l1
sim_loss_coef=1
neg_loss_coef=0.5
exp_id=test
seed=2023
lr=1e-4
lr_gamma=0.1
neg_choose_epoch=80
lr_drop=100
resume=path_to_ckpt/QV_scratch.ckpt
######## data paths
train_path=data/highlight_train_release.jsonl
eval_path=data/highlight_val_release.jsonl
eval_split_name=val
######## setup video+text features
feat_root=path_to_qv_features/features
# video features
v_feat_dim=0
v_feat_dirs=()
if [[ ${v_feat_types} == *"slowfast"* ]]; then
v_feat_dirs+=(${feat_root}/slowfast_features)
(( v_feat_dim += 2304 )) # double brackets for arithmetic op, no need to use ${v_feat_dim}
fi
if [[ ${v_feat_types} == *"clip"* ]]; then
v_feat_dirs+=(${feat_root}/clip_features)
(( v_feat_dim += 512 ))
fi
# text features
if [[ ${t_feat_type} == "clip" ]]; then
t_feat_dir=${feat_root}/clip_text_features/
t_feat_dim=512
else
echo "Wrong arg for t_feat_type."
exit 1
fi
#### training
bsz=32
PYTHONPATH=$PYTHONPATH:. python uvcom/eval.py \
--dset_name ${dset_name} \
--ctx_mode ${ctx_mode} \
--train_path ${train_path} \
--eval_path ${eval_path} \
--eval_split_name ${eval_split_name} \
--v_feat_dirs ${v_feat_dirs[@]} \
--v_feat_dim ${v_feat_dim} \
--t_feat_dir ${t_feat_dir} \
--t_feat_dim ${t_feat_dim} \
--bsz ${bsz} \
--results_root ${results_root} \
--exp_id ${exp_id} \
--device ${device} \
--span_loss_type ${span_loss_type} \
--lr ${lr} \
--num_queries ${query_num} \
--enc_layers ${enc_layers} \
--sim_loss_coef ${sim_loss_coef} \
--neg_loss_coef ${neg_loss_coef} \
--seed ${seed} \
--lr_gamma ${lr_gamma} \
--dec_layers ${dec_layers} \
--lr_drop ${lr_drop} \
--em_iter 5 \
--n_txt_mu ${n_txt_mu} \
--n_visual_mu ${n_visual_mu} \
--resume ${resume} \
--neg_choose_epoch ${neg_choose_epoch}\
${@:1}