]> rtime.felk.cvut.cz Git - hercules2020/kcf.git/blob - print-test-results
Remove debug printf
[hercules2020/kcf.git] / print-test-results
1 #!/bin/bash
2 set -e
3
4 declare -A expected_accuracy
5
6 expected_accuracy=([bag]=0.53 [ball1-correct]=0.65 [ball1]=0.27 [car1]=0.35 [book]=0.19
7                    [bmx]=0.38 [crossing]=0.48 [racing]=0.52)
8
9 for i in "$@"; do
10     [[ "$i" =~ build-(.*)/kcf_vot-(.*)-(.*).log ]]
11     build=${BASH_REMATCH[1]}
12     flags=${BASH_REMATCH[3]}
13     seq=${BASH_REMATCH[2]}
14
15     result=$(grep 'Average accuracy:' $i | sed -e 's/Average/Avg./g' -e 's/processing //' || :)
16     expected="${expected_accuracy[$seq]:-0}"
17
18     # Work around problem with OpenCV version on Travis, which causes test failures
19     if [[ -n "$TRAVIS" && $seq = ball1 && $build =~ opencvfft && $flags = fit ]]; then
20         expected=0.10
21     fi
22
23     if [[ "$result" =~ accuracy:\ ([0-9.]+) ]]; then
24         result+=" >= $expected"
25         if [[ $(echo "${BASH_REMATCH[1]} >= ${expected}"|bc) -eq 1 ]]; then
26             status=ok
27         else
28             status=ACCURACY
29         fi
30     else
31         status=FAILED
32     fi
33     echo ! "$seq;$flags;$build;$result;$status"
34 done | sort -t";" $SORT_FLAGS | column -t -s";"