batch_test.sh 669 Bytes
Newer Older
Nianchen Deng's avatar
sync    
Nianchen Deng committed
1
2
3
4
5
#!/bin/bash

test_dataset=$1
test_model_dir=$2

Nianchen Deng's avatar
sync    
Nianchen Deng committed
6
for misc_path in "$test_model_dir"/*/_misc/checkpoint_30.tar
Nianchen Deng's avatar
sync    
Nianchen Deng committed
7
do
Nianchen Deng's avatar
sync    
Nianchen Deng committed
8
9
10
11
12
13
14
15
16
17
18
19
    [ -f "$misc_path" ] || continue
    misc_dir=$(dirname "$misc_path")
    echo mv "$misc_path" "${misc_dir%/*}"
    mv "$misc_path" "${misc_dir%/*}"
done


for model_path in "$test_model_dir"/*/checkpoint_30.tar
do
    model_dir=$(dirname "$model_path")
    #model_name=${model_dir#"$test_model_dir/"}
    [ -d "$model_dir/output_30" ] || python test.py "$model_path" "$test_dataset" -o perf --media image
Nianchen Deng's avatar
sync    
Nianchen Deng committed
20
21
22
23
done

echo Test Finished

Nianchen Deng's avatar
sync    
Nianchen Deng committed
24
25
26
cd "$test_model_dir"
ls */output_30/perf* | sed -r "s/()\/output_30\/perf.+_([0-9\.]+)ms_([0-9\.e\-]+)\.csv/\1\t\2\t\3/"