forked from CMU-CREATE-Lab/deep-smoke-machine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbg.sh
63 lines (57 loc) · 2.25 KB
/
bg.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
#!/bin/sh
# This script runs a python script using screen command
# For example:
# sh bg.sh python train.py i3d-rgb
# Get file path
if [ "$1" != "" ] && [ "$2" != "" ]
then
echo "Run: $1 $2 $3 $4 $5 $6"
else
echo "Usage examples:\n\
sh bg.sh python download_videos.py\n\
sh bg.sh python process_videos.py\n\
sh bg.sh python compute_dark_channel.py\n\
sh bg.sh python perturb_frames.py\n\
sh bg.sh python extract_features.py i3d-rgb\n\
sh bg.sh python extract_features.py i3d-flow\n\
sh bg.sh python train.py i3d-rgb-cv-1\n\
sh bg.sh python train.py i3d-ft-tc-rgb-cv-1\n\
sh bg.sh python train.py i3d-tsm-rgb-cv-1\n\
sh bg.sh python train.py i3d-nl-rgb-cv-1\n\
sh bg.sh python train.py i3d-ft-lstm-rgb-cv-1\n\
sh bg.sh python train.py i3d-flow-cv-1\n\
sh bg.sh python train.py i3d-rgbd-cv-1\n\
sh bg.sh python train.py cnn-rgb-cv-1\n\
sh bg.sh python train.py cnn-ft-tc-rgb-cv-1\n\
sh bg.sh python train.py svm-rgb-cv-1\n\
sh bg.sh python train.py svm-flow-cv-1\n\
sh bg.sh python test.py i3d-rgb-cv-1 [model_path]\n\
sh bg.sh python test.py i3d-ft-tc-rgb-cv-1 [model_path]\n\
sh bg.sh python test.py i3d-tsm-rgb-cv-1 [model_path]\n\
sh bg.sh python test.py i3d-nl-rgb-cv-1 [model_path]\n\
sh bg.sh python test.py i3d-ft-lstm-rgb-cv-1 [model_path]\n\
sh bg.sh python test.py i3d-flow-cv-1 [model_path]\n\
sh bg.sh python test.py i3d-rgbd-cv-1 [model_path]\n\
sh bg.sh python test.py cnn-rgb-cv-1 [model_path]\n\
sh bg.sh python test.py cnn-ft-tc-rgb-cv-1 [model_path]\n\
sh bg.sh python test.py svm-rgb-cv-1 [model_path]\n\
sh bg.sh python test.py svm-flow-cv-1 [model_path]\n\
sh bg.sh python grad_cam_viz.py i3d-rgb [model_path]\n\
sh bg.sh python recognize_smoke.py process_all_urls\n\
sh bg.sh python recognize_smoke.py process_events\n\
sh bg.sh python recognize_smoke.py scan_urls"
exit 1
fi
# Delete existing screen
for session in $(sudo screen -ls | grep -o "[0-9]*.$1.$2.$3")
do
sudo screen -S "${session}" -X quit
sleep 2
done
# Delete the log
sudo rm screenlog.0
# For python in conda env in Ubuntu
sudo screen -dmSL "$1.$2.$3" bash -c "export PATH='/opt/miniconda3/bin:$PATH'; . '/opt/miniconda3/etc/profile.d/conda.sh'; conda activate deep-smoke-machine; $1 $2 $3 $4 $5 $6"
# List screens
sudo screen -ls
exit 0