tesseract-ocr / tesstrain

Train Tesseract LSTM with make
Apache License 2.0
637 stars 188 forks source link

Can it be used on Windows? #9

Closed yzy1996 closed 6 years ago

yzy1996 commented 6 years ago

I have try the command line on Windows, it does not work.

D:\MyGithub\ocrd-train-master>  make leptonica tesseract langdata
wget 'http://www.leptonica.org/source/leptonica-1.76.0.tar.gz'
process_begin: CreateProcess(NULL, wget http://www.leptonica.org/source/leptonica-1.76.0.tar.gz, ...) failed.
make (e=2):
Makefile:141: recipe for target 'leptonica-1.76.0.tar.gz' failed
make: *** [leptonica-1.76.0.tar.gz] Error 2

python generate_line_box.py -i "data/train/alexis_ruhe01_1852_0035_019.tif" -t "data/train/alexis_ruhe01_1852_0035_019.gt.txt" > "data/train/alexis_ruhe01_1852_0035_019.box"
Traceback (most recent call last):
  File "generate_line_box.py", line 26, in <module>
    im = Image.open(file(args.image, "r"))
NameError: name 'file' is not defined
Makefile:91: recipe for target 'data/train/alexis_ruhe01_1852_0035_019.box' failed
make: *** [data/train/alexis_ruhe01_1852_0035_019.box] Error 1
kba commented 6 years ago

We only develop for Ubuntu Linux at the moment. @UB-Mannheim maintains a Windows installer for tesseract 4. I'm not sure whether it bundles the training tools though.

You could try to compile this within cygwin or Win10's bash environment, not sure how compatible these are with native Linux though.

The first error is because you're missing wget in your path.

The second error is because file in Python 2 is mostly synonymous with open but is gone as a global keyword in Python 3 which you seem to be using. This we will fix, I'll open an issue.

yzy1996 commented 6 years ago

Thank you! I have tried with Ubuntu and it work well.

kba commented 6 years ago

At the moment, no plans for Windows support.