forked from felipegb94/compressive-spad-lidar-cvpr22
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eval_coding_flash_lidar_scene_batch.sh
executable file
·144 lines (129 loc) · 5.96 KB
/
eval_coding_flash_lidar_scene_batch.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/bin/bash
# run eval_coding_flash_lidar_scene.py -scene_id kitchen-2 -sbr 0.5 -nphotons 1000 -n_rows 240 -n_cols 320 -n_tbins 2000 -coding PSeriesFourier -n_freqs 8
## Simulation Parameters
scene_id=kitchen-2 # Options: kitchen-2, bathroom-cycles-2
# scene_id=bathroom-cycles-2 # Options: kitchen-2, bathroom-cycles-2
n_tbins=2000
n_rows=240
n_cols=320
pw_factor_shared=1 # pulse width in units of time bins
# Set noise levels
sbr=1
nphotons=2000
## Set shared coding params
# n_codes=(10 20 40 80)
# n_codes=(3 8 10 20)
# n_codes=(20)
n_codes=(20 40 80)
## Create simulation parameter string
SIM_PARAM_STR=' -scene_id '$scene_id' -n_tbins '$n_tbins' -n_rows '$n_rows' -n_cols '$n_cols
NOISE_PARAM_STR=' -sbr '$sbr' -nphotons '$nphotons
SHARED_PARAM_STR=$SIM_PARAM_STR$NOISE_PARAM_STR' --save_data_results --account_irf'
echo $SHARED_PARAM_STR
############# TruncatedFourier Coding #############
coding_id='TruncatedFourier'
pw_factor=$pw_factor_shared
rec_algo_id='ncc'
SHARED_CODING_PARAM_STR=' -coding '$coding_id' -pw_factors '$pw_factor' -rec '$rec_algo_id
CURR_CODING_PARAM_STR=''
n_simulations=${#n_codes[@]}
## Use bash for loop
for (( i=0; i<$n_simulations; i++ )); do
n_freqs=$((n_codes[$i] / 2))
CURR_CODING_PARAM_STR=' -n_freqs '${n_freqs}
echo python eval_coding_flash_lidar_scene.py $SHARED_PARAM_STR $SHARED_CODING_PARAM_STR $CURR_CODING_PARAM_STR
python eval_coding_flash_lidar_scene.py $SHARED_PARAM_STR $SHARED_CODING_PARAM_STR $CURR_CODING_PARAM_STR
done
############# PSeriesFourier Coding #############
coding_id='PSeriesFourier'
pw_factor=$pw_factor_shared
rec_algo_id='ncc'
SHARED_CODING_PARAM_STR=' -coding '$coding_id' -pw_factors '$pw_factor' -rec '$rec_algo_id
CURR_CODING_PARAM_STR=''
n_simulations=${#n_codes[@]}
## Use bash for loop
for (( i=0; i<$n_simulations; i++ )); do
n_freqs=$((n_codes[$i] / 2))
CURR_CODING_PARAM_STR=' -n_freqs '${n_freqs}
echo python eval_coding_flash_lidar_scene.py $SHARED_PARAM_STR $SHARED_CODING_PARAM_STR $CURR_CODING_PARAM_STR
python eval_coding_flash_lidar_scene.py $SHARED_PARAM_STR $SHARED_CODING_PARAM_STR $CURR_CODING_PARAM_STR
done
############# PSeriesGray Coding -- Similar to GrayCoding when K <= log2(N)#############
coding_id='PSeriesGray'
pw_factor=$pw_factor_shared
rec_algo_id='ncc'
SHARED_CODING_PARAM_STR=' -coding '$coding_id' -pw_factors '$pw_factor' -rec '$rec_algo_id
CURR_CODING_PARAM_STR=''
n_simulations=${#n_codes[@]}
## Use bash for loop
for (( i=0; i<$n_simulations; i++ )); do
CURR_CODING_PARAM_STR=' -n_psergray_codes '${n_codes[$i]}
echo python eval_coding_flash_lidar_scene.py $SHARED_PARAM_STR $SHARED_CODING_PARAM_STR $CURR_CODING_PARAM_STR
python eval_coding_flash_lidar_scene.py $SHARED_PARAM_STR $SHARED_CODING_PARAM_STR $CURR_CODING_PARAM_STR
done
############# Gated Coding (Narrow Pulse Width - Quantization Limited) #############
coding_id='Gated'
pw_factor=$pw_factor_shared
rec_algo_id='linear'
SHARED_CODING_PARAM_STR=' -coding '$coding_id' -pw_factors '$pw_factor' -rec '$rec_algo_id
CURR_CODING_PARAM_STR=''
n_simulations=${#n_codes[@]}
## Use bash for loop
for (( i=0; i<$n_simulations; i++ )); do
CURR_CODING_PARAM_STR=' -n_gates '${n_codes[$i]}
echo python eval_coding_flash_lidar_scene.py $SHARED_PARAM_STR $SHARED_CODING_PARAM_STR $CURR_CODING_PARAM_STR
python eval_coding_flash_lidar_scene.py $SHARED_PARAM_STR $SHARED_CODING_PARAM_STR $CURR_CODING_PARAM_STR
done
############# Gated Coding (Wide Pulse Width - Quantization Limited) #############
coding_id='Gated'
rec_algo_id='linear'
SHARED_CODING_PARAM_STR=' -coding '$coding_id' -pw_factors '$pw_factor' -rec '$rec_algo_id
CURR_CODING_PARAM_STR=''
n_simulations=${#n_codes[@]}
## Use bash for loop
for (( i=0; i<$n_simulations; i++ )); do
pw_factor=$((n_tbins / ${n_codes[$i]}))
# If the pw_factor is smaller, the truncate it
if [ "$pw_factor" -lt "$pw_factor_shared" ]; then
pw_factor=$pw_factor_shared
fi
SHARED_CODING_PARAM_STR=' -coding '$coding_id' -pw_factors '$pw_factor' -rec '$rec_algo_id
CURR_CODING_PARAM_STR=' -n_gates '${n_codes[$i]}
echo python eval_coding_flash_lidar_scene.py $SHARED_PARAM_STR $SHARED_CODING_PARAM_STR $CURR_CODING_PARAM_STR
python eval_coding_flash_lidar_scene.py $SHARED_PARAM_STR $SHARED_CODING_PARAM_STR $CURR_CODING_PARAM_STR
done
############# Identity Coding (Matched Filter Rec) #############
coding_id='Identity'
pw_factor=$pw_factor_shared
rec_algo_id='matchfilt'
SHARED_CODING_PARAM_STR=' -coding '$coding_id' -pw_factors '$pw_factor' -rec '$rec_algo_id
CURR_CODING_PARAM_STR=''
python eval_coding_flash_lidar_scene.py $SHARED_PARAM_STR $SHARED_CODING_PARAM_STR $CURR_CODING_PARAM_STR
# ############# Random Coding #############
# coding_id='Random'
# pw_factor=$pw_factor_shared
# rec_algo_id='ncc'
# SHARED_CODING_PARAM_STR=' -coding '$coding_id' -pw_factors '$pw_factor' -rec '$rec_algo_id
# CURR_CODING_PARAM_STR=''
# n_simulations=${#n_codes[@]}
# ## Use bash for loop
# for (( i=0; i<$n_simulations; i++ )); do
# CURR_CODING_PARAM_STR=' -n_random_codes '${n_codes[$i]}
# echo python eval_coding_flash_lidar_scene.py $SHARED_PARAM_STR $SHARED_CODING_PARAM_STR $CURR_CODING_PARAM_STR
# python eval_coding_flash_lidar_scene.py $SHARED_PARAM_STR $SHARED_CODING_PARAM_STR $CURR_CODING_PARAM_STR
# done
# ############# HighFreqFourier Coding #############
# coding_id='HighFreqFourier'
# pw_factor=$pw_factor_shared
# rec_algo_id='ncc'
# SHARED_CODING_PARAM_STR=' -coding '$coding_id' -pw_factors '$pw_factor' -rec '$rec_algo_id
# CURR_CODING_PARAM_STR=''
# n_simulations=${#n_codes[@]}
# start_high_freq=40
# ## Use bash for loop
# for (( i=0; i<$n_simulations; i++ )); do
# n_high_freqs=$((n_codes[$i] / 2))
# CURR_CODING_PARAM_STR=' -n_high_freqs '${n_high_freqs}' -start_high_freq '${start_high_freq}
# echo python eval_coding_flash_lidar_scene.py $SHARED_PARAM_STR $SHARED_CODING_PARAM_STR $CURR_CODING_PARAM_STR
# python eval_coding_flash_lidar_scene.py $SHARED_PARAM_STR $SHARED_CODING_PARAM_STR $CURR_CODING_PARAM_STR
# done