Skip to content

Commit

Permalink
tesstrain: catch+handle SIGINT (to stop waiting on subjobs)
Browse files Browse the repository at this point in the history
  • Loading branch information
bertsky committed Mar 14, 2019
1 parent 6cbad17 commit 14346e5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/training/tesstrain_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ phase_I_generate_image() {
fi

local jobs=
trap "kill $$" INT
for font in "${FONTS[@]}"; do
sleep 1
test $(jobs -r | wc -l) -ge $par_factor && wait -n
Expand Down Expand Up @@ -444,6 +445,7 @@ phase_E_extract_features() {
export TESSDATA_PREFIX=${TESSDATA_DIR}
tlog "Using TESSDATA_PREFIX=${TESSDATA_PREFIX}"
local jobs=
trap "kill $$" INT
for img_file in ${img_files}; do
test $(jobs -r | wc -l) -ge $par_factor && wait -n
run_command tesseract ${img_file} ${img_file%.*} \
Expand Down

0 comments on commit 14346e5

Please sign in to comment.