Skip to content

Commit ecf73f5

Browse files
committed
training: Don't terminate after processing 8 fonts or 8 images
tesstrain_utils.sh sets the shell flag -e, so it exits immediately if a command exits with a non-zero status. The following command returns a non-zero status as soon as counter is a multiple of par_factor (par_factor=8, that means as soon as 8 fonts or images are processed): let rem=counter%par_factor The new code fixes this undesired exit. Signed-off-by: Stefan Weil <[email protected]>
1 parent a6da642 commit ecf73f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/training/tesstrain_utils.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ phase_I_generate_image() {
303303
sleep 1
304304
generate_font_image "${font}" &
305305
let counter=counter+1
306-
let rem=counter%par_factor
306+
let rem=counter%par_factor || true
307307
if [[ "${rem}" -eq 0 ]]; then
308308
wait
309309
fi
@@ -436,7 +436,7 @@ phase_E_extract_features() {
436436
run_command tesseract ${img_file} ${img_file%.*} \
437437
${box_config} ${config} &
438438
let counter=counter+1
439-
let rem=counter%par_factor
439+
let rem=counter%par_factor || true
440440
if [[ "${rem}" -eq 0 ]]; then
441441
wait
442442
fi

0 commit comments

Comments
 (0)