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

datadir='data/__new/lobby_fovea_r360x80_t1.0'
Nianchen Deng's avatar
Nianchen Deng committed
4
5
6
7
trainsetname='train1'
testsetname='test1'
trainset="data/__new/lobby_fovea_r360x80_t1.0/$trainsetname.json"
testset="data/__new/lobby_fovea_r360x80_t1.0/$testsetname.json"
Nianchen Deng's avatar
sync    
Nianchen Deng committed
8
9
10
11
12
13
epochs=50

n_nets=$1
nf=$2
n_layers=$3

Nianchen Deng's avatar
Nianchen Deng committed
14
configid="fovea@snerffast${n_nets}-rgb_e6_fc${nf}x${n_layers}_d2.00-50.00_s64_~p"
Nianchen Deng's avatar
sync    
Nianchen Deng committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
if [ ! -f "$datadir/$configid/model-epoch_$epochs.pth" ]; then
    cont_epoch=0
    for ((i=$epochs-1;i>0;i--)) do
        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
    fi
fi
if ! ls $datadir/$configid/output_$epochs/perf_* >/dev/null 2>&1; then
    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
Nianchen Deng's avatar
Nianchen Deng committed
32
33
34
35
fi
if [ ! -d "$datadir/$configid/output_$epochs/${testsetname}_color" ]; then
    python run_spherical_view_syn.py $testset -t -m $configid/model-epoch_$epochs.pth -o color
fi