-
Notifications
You must be signed in to change notification settings - Fork 5
/
script_saliency.sh
54 lines (49 loc) · 1.16 KB
/
script_saliency.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
#!/bin/bash
source activate pyRL
PHASE=$1
GPU_IDS=0
LOG_DIR="./logs/saliency"
if [ ! -d $LOG_DIR ]; then
mkdir -p -m 777 $LOG_DIR
echo "mkdir -p -m 777 ${LOG_DIR} done"
fi
rm -rf ${LOG_DIR}/${PHASE}_saliency_*.log
LOG="${LOG_DIR}/${PHASE}_saliency_`date +'%Y-%m-%d_%H-%M'`.log"
exec &> >(tee -a "$LOG")
echo Logging output to "$LOG"
case ${PHASE} in
train)
rm -rf output/saliency/*
# run training
CUDA_VISIBLE_DEVICES=$GPU_IDS python main_saliency.py \
--phase train \
--batch_size 1 \
--frame_interval 5 \
--max_frames 32 \
--input_shape 480 640 \
--epoch 40 \
--gpus $GPU_IDS \
--num_workers 4 \
--output ./output/saliency
;;
test)
# run testing
CUDA_VISIBLE_DEVICES=$GPU_IDS python main_saliency.py \
--phase test \
--input_shape 480 640 \
--gpus $GPU_IDS \
--output ./output/saliency \
--model_weights saliency_model_25.pth
;;
evaluate)
# evaluate the results
python main_saliency.py \
--phase eval \
--output ./output/saliency
;;
*)
echo "Invalid argument!"
exit
;;
esac
echo "Done!"