summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.name>2022-10-14 11:30:05 +0100
committerNick White <git@njw.name>2022-10-14 11:30:05 +0100
commit98b3298a6247ee78fa81412e3c520a5b03f7ffaa (patch)
tree2ef8fbea76aeb111ac1ec3387c0903d5f0620eec
parente3bb89a2289e41321f4e3a3905982464279d0fec (diff)
force python3 in traintess
-rwxr-xr-xtesttraining.sh17
-rwxr-xr-xtraintess.sh2
2 files changed, 11 insertions, 8 deletions
diff --git a/testtraining.sh b/testtraining.sh
index 686dae8..263ba7a 100755
--- a/testtraining.sh
+++ b/testtraining.sh
@@ -15,7 +15,7 @@ find "$evaldir" -type f -name '*txt' | while read i; do
test -f "$d/$b.box" && continue
test -f "$d/${b}_lstmf.lstmf" && continue
- python "${here}/generate_line_box.py" -i "$d/$b.png" -t "$i" > "$d/$b.box" || exit 1
+ python3 "${here}/generate_line_box.py" -i "$d/$b.png" -t "$i" > "$d/$b.box"
done
@@ -27,17 +27,20 @@ find "$evaldir" -type f -name '*box' | while read i; do
# skip generating lstmf files if they're already present
test -f "$d/${b}_lstmf.lstmf" && continue
- tesseract "$d/$b.png" "$d/${b}_lstmf" --psm 6 lstm.train 2>/dev/null || exit 1
+ tesseract "$d/$b.png" "$d/${b}_lstmf" --psm 6 lstm.train
# the lstm.train process creates a blank .txt
- rm -f "$d/${b}_lstmf.txt"
- rm -f "$i"
+ #rm -f "$d/${b}_lstmf.txt"
+ #rm -f "$i"
done
find "$evaldir" -type f -name '*lstmf' > "$evaldir/list"
# Run lstmeval
-evalout=`lstmeval --model "$1" --eval_listfile "$evaldir/list" -verbosity 0 2>&1`
+lstmeval --model "$1" --eval_listfile "$evaldir/list" -verbosity 2 2>&1
+exit
+evalout=`lstmeval --model "$1" --eval_listfile "$evaldir/list" 2>&1`
test $? -ne 0 && echo "Error in lstmeval: $evalout"
-echo "$evalout" | awk '/Char error rate/ {print $7 " " $8 " " $9 " " $10 " " $11 " " $12}'
+echo "$evalout"
+#echo "$evalout" | awk '/Char error rate/ {print $7 " " $8 " " $9 " " $10 " " $11 " " $12}'
-rm -f "$evaldir/list"
+#rm -f "$evaldir/list"
diff --git a/traintess.sh b/traintess.sh
index 9f4174d..870fef9 100755
--- a/traintess.sh
+++ b/traintess.sh
@@ -55,7 +55,7 @@ find "$name/gt" "$name/eval" -type f -name '*txt' | while read i; do
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 "${here}/generate_line_box.py" -i "$d/$n" -t "$i" > "$d/$b.box" || exit 1
+ python3 "${here}/generate_line_box.py" -i "$d/$n" -t "$i" > "$d/$b.box" || exit 1
done
echo "Making unicharset"