summaryrefslogtreecommitdiff
path: root/traintessv4.sh
diff options
context:
space:
mode:
authorNick White <git@njw.name>2019-04-02 16:20:03 +0100
committerNick White <git@njw.name>2019-04-02 16:20:03 +0100
commitc069e17eed77d19d4a11e3d80143f310a46039bf (patch)
tree626898fd6a021cb69c9e0879d3c13739a76ee21e /traintessv4.sh
parentb1731f0f286dbbfc12b7f152f6554dcdbff85061 (diff)
Fix bugs in traintessv4.sh
Diffstat (limited to 'traintessv4.sh')
-rwxr-xr-xtraintessv4.sh11
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"