diff options
-rwxr-xr-x | traintessv4.sh | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/traintessv4.sh b/traintessv4.sh index 948397b..9e4e8f4 100755 --- a/traintessv4.sh +++ b/traintessv4.sh @@ -37,11 +37,14 @@ done echo "Making box files" find "$name/gt" "$name/eval" -type f -name '*txt' | while read i; do - b=`basename "$i"` + b=`basename "$i" .txt` d=`dirname "$i"` - test -f "$b.tif" && n="$b.tif" - test -f "$b.png" && n="$b.png" - python generate_line_box.py -i "$d/$n" -t "$i" > "$d/$b.box" || exit 1 + n="" + test -f "$d/$b.tif" && n="$b.tif" + test -f "$d/$b.png" && n="$b.png" + test -z "$n" && echo "Skipping $i as no corresponding image found" && continue + test -f "$d/$b.box" && echo "Skipping $i as box file already present" && continue + python ~/training/generate_line_box.py -i "$d/$n" -t "$i" > "$d/$b.box" || exit 1 done echo "Making unicharset" |