Closed jbarth-ubhd closed 3 years ago
ah... >
is n
, (
is e
...
Perhaps I could build some machine learning algorithm to decipher this.
That looks a bit like rot13 but not quite ;) I suspect the unicharset
got corrupted when combining the traineddata files.
Since you aren't actually using tesstrain but tesseract's training tools directly, you might want to ask on the tesseract mailing list.
Is font "fine tuning" possible with tesstrain.sh
and nothing else?
Fine tuning uses lstmtraining
. And that is used by the old tesstrain.sh
or the replacement tesstrain.py
scripts (both part of the tesseract
repository), and it is also used by the Makefile of the tesstrain
repository. All of them support fine tuning. And of course you can write your own wrappers.
I usually use the tesstrain
Makefile for fine tuning.
Output looks similar to that reported in Tesseract issue https://github.com/tesseract-ocr/tesseract/issues/1603
tesseract-ocr/tesseract#1603 looks like real OCR issues, whereas the output by @jbarth-ubhd has a 1:1 mapping to the correct prediction. I.e. 8
is consistently i
etc. This could probably fixed with a tr(1)
call, so I think the character set got jumbled in some weird way.
That could be fixed by replacing the unicharset component in the model file. It looks like somewhere in Jochens workflow a wrong unicharset was used.
Thanks for the hint @stweil. Following should fix it (haven't tested it though)
lstmtraining --stop_training \
--continue_from ~/tesstutorial/bembo_from_full/bembo_checkpoint \
--traineddata tessdata/best/deu.traineddata \
--model_output ~/tesstutorial/bembo_from_full/deu.traineddata
--traineddata should be same as used in lstmtraining command. The unicharset is used from that.
@kba I had missed the one to one mapping in output.
Thanks! Helps. PS: Did copy the commands from https://tesseract-ocr.github.io/tessdoc/TrainingTesseract-4.00 with this modification: impact -> bembo, eng -> deu.
Documentation will need to be updated.
@jbarth-ubhd
You can create single line png and gt.txt files from lstmf files using unpack
feature (see https://github.com/tesseract-ocr/tesseract/issues/2669#issuecomment-569782835) from @stweil's repo. Those files can then be used as input for tesstrain
.
Dear reader, I'm trying to improve the deu.traineddata using the Bembo font. Tried with tesseract-4.1.1 and current master; did the following:
OCR before training with
tessdata/best/deu.traineddata
:after training, model
tesstutorial/bembo_from_full/deu.traineddata
: