From c069e17eed77d19d4a11e3d80143f310a46039bf Mon Sep 17 00:00:00 2001 From: Nick White Date: Tue, 2 Apr 2019 16:20:03 +0100 Subject: Fix bugs in traintessv4.sh --- traintessv4.sh | 11 +++++++---- 1 file 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" -- cgit v1.2.1-24-ge1ad