
Show HN: tesserocr – A Python wrapper for the tesseract-ocr API - reubano
https://github.com/sirfz/tesserocr
======
reubano
This differs from other python wrappers like pytesseract [1] and pyocr [2] in
that tesserocr binds the tesseract c-api. The others call out to the tesseract
executable via `subprocess`.

[1]
[https://github.com/madmaze/pytesseract](https://github.com/madmaze/pytesseract)
[2] [https://github.com/jflesch/pyocr](https://github.com/jflesch/pyocr)

~~~
reubano
slight correction, pyocr has three apis: Libtesseract, Tesseract, and
Cuneiform. The first calls the c-api while the other two call an executable.

------
ddmf
Strangely enough started using pytesseract yesterday and realised it was
subprocess only.

Thanks, will give this a try instead :)

~~~
sirfz
Hey ddmf, you might want to use the latest beta version directly from the
master branch of the repo as it has an important issue fixed (the way the PIL
image is converted to pix). Otherwise it's safer to use the SetImageFile
method instead of SetImage.

------
unusximmortalis
Isn't the GIL the way not to go if you really want to be multithreaded and
with good performance?

~~~
sirfz
tesserocr releases the Global Interpreter Lock (GIL) while performing some
tasks which allows threads to run them in parallel without waiting for the GIL
to be available.

------
doppenhe
This is great. Did you tune the recognition models at all or is it straight
tesseract plus the wrapper.

~~~
sirfz
The aim of the project was to bring most tesseract's API functionality to a
pythonic interface without the need for any subprocess calls. No model tuning
involved, just a wrapper :)

~~~
zo1
Great work, btw!

Feature request: It would be great if you could also hook-in to the model
training API, if any, of Tesseract. That way, you could drive the training via
python rather than using Tesseract's accompanying executables.

~~~
sirfz
It's possible the required methods are already there but I'll look into it.
Would be cool if you open an issue on GitHub. Thanks for the feedback :)

------
batar
Could someone guide me to a step by step guide for installing it in windows ?

~~~
sirfz
It was never tested on Windows, perhaps you can try the Linux steps on Cygwin?
I'm interested in seeing how this can work on Windows as I developed this with
Linux in mind which was suitable for my use-case

~~~
batar
I have cygwin installed on my machine., I ll give it a shot.

