batch_infer.sh 1.77 KB
Newer Older
Nianchen Deng's avatar
sync    
Nianchen Deng committed
1
#!/usr/bin/bash
Nianchen Deng's avatar
sync    
Nianchen Deng committed
2
3

testcase=$1
4
5
6
datadir='data/__new/classroom_fovea_r360x80_t0.6'
trainset='data/__new/classroom_fovea_r360x80_t0.6/r120x80.json'
testset='data/__new/classroom_fovea_r360x80_t0.6/r120x80_test.json'
Nianchen Deng's avatar
Nianchen Deng committed
7
videoset='data/__new/classroom_fovea_r360x80_t0.6/helix.json'
Nianchen Deng's avatar
Nianchen Deng committed
8
epochs=50
Nianchen Deng's avatar
sync    
Nianchen Deng committed
9

10
11
# nets: 1, 2, 4, 8
# layers: 2, 4, 8
Nianchen Deng's avatar
sync    
Nianchen Deng committed
12
# channels: 64 128 256 512 1024
13
14
15
n_nets_arr=(1 2 4 8 1 2 4 8 1 2 4 8)
n_layers_arr=(2 2 2 2 4 4 4 4 8 8 8 8)
n_nets=${n_nets_arr[$testcase]}
Nianchen Deng's avatar
Nianchen Deng committed
16
n_layers=${n_layers_arr[$testcase]}
17
18
19

for nf in 64 128 256 512 1024; do
    configid="eval@snerffast${n_nets}-rgb_e6_fc${nf}x${n_layers}_d1.00-7.00_s64_~p"
Nianchen Deng's avatar
sync    
Nianchen Deng committed
20
21
    if [ ! -f "$datadir/$configid/model-epoch_$epochs.pth" ]; then
        cont_epoch=0
Nianchen Deng's avatar
sync    
Nianchen Deng committed
22
        for ((i=epochs-1;i>0;i--)) do
Nianchen Deng's avatar
sync    
Nianchen Deng committed
23
24
25
26
27
28
29
30
31
            if [ -f "$datadir/$configid/model-epoch_$i.pth" ]; then
                cont_epoch=$i
                break
            fi
        done
        if [ ${cont_epoch} -gt 0 ]; then
            python run_spherical_view_syn.py $trainset -e $epochs -m $configid/model-epoch_${cont_epoch}.pth
        else
            python run_spherical_view_syn.py $trainset -i $configid -e $epochs
32
33
        fi
    fi
Nianchen Deng's avatar
Nianchen Deng committed
34
    if ! ls $datadir/$configid/output_$epochs/perf* >/dev/null 2>&1; then
Nianchen Deng's avatar
sync    
Nianchen Deng committed
35
36
37
        python run_spherical_view_syn.py $trainset -t -m $configid/model-epoch_$epochs.pth -o perf
        python run_spherical_view_syn.py $testset -t -m $configid/model-epoch_$epochs.pth -o perf
    fi
Nianchen Deng's avatar
Nianchen Deng committed
38
39
40
41
42
43
    if [ ! -d "$datadir/$configid/output_$epochs/r120x80_test_color" ]; then
        python run_spherical_view_syn.py $testset -t -m $configid/model-epoch_$epochs.pth -o color
    fi
    if [ ! -f "$datadir/$configid/output_$epochs/helix_color.mp4" ]; then
        python run_spherical_view_syn.py $videoset -t -m $configid/model-epoch_$epochs.pth -o color --output-type video
    fi
Nianchen Deng's avatar
sync    
Nianchen Deng committed
44
done