#!/bin/sh -e

[ -d dataset ] || exit 1

correct=0
count=0
total=$(printf '%s\n' dataset/* | wc -l)

for i in dataset/*.png ; do
    res=$(bash ./gotcha "$i")
    i=${i#dataset/}
    if [ "$res" = "${i%.png}" ] ; then
        correct=$((correct + 1))
        status=SUCCESS
    else
        status=FAIL
    fi
    printf '%s\n' "$status: [count: $count | correct: $correct/$total] - ANS: ${i%.png} RES: $res"
    count=$((count + 1))
done

echo
echo 'Done!'
