hyperrixel / pytessy Goto Github PK
View Code? Open in Web Editor NEWFaster access to Tesseract-OCR from Python
License: Boost Software License 1.0
Faster access to Tesseract-OCR from Python
License: Boost Software License 1.0
First off, thanks for this library, it sped up the OCR in my code by 8-10x relative to pytesseract (which I was using previously).
I've noticed a couple of bugs in the (0.1.0) code though:
AttributeError
for me so I had to change it (I just used dirname(abspath(__file__))
instead, which sets the working dir to where pytessy is installed).justread_raw
calls get_text
, I think it should be calling get_text_raw
instead.For reference and for future users, I'm leaving my code here as a sample:
from pytessy.pytessy import PyTessy
ocr = PyTessy(r'C:\Program Files\Tesseract-OCR\tesseract')
bytes = img.tobytes() # img is a numpy array, such as from np.array(PIL.Image.open(file))
h, w = img.shape[:2]
bpp = len(bytes) // (w * h)
txt = ocr.read(bytes, w, h, bpp)
please provide documentaion
Do you plan to create a new release based on PR and other forks?
pip3 install pytessy
import pytessy
from PIL import ImageFilter, Image
ocrReader = pytessy.PyTessy()
C:\Users\hp\Documents\Projects\ExtractImageLoc>python pytessy.py
Traceback (most recent call last):
File "pytessy.py", line 2, in
import pytessy
File "C:\Users\hp\Documents\Projects\ExtractImageLoc\pytessy.py", line 11, in
ocrReader = pytessy.PyTessy()
AttributeError: module 'pytessy' has no attribute 'PyTessy'
Hi! Looks very interesting. Are there any docs, and some sample code? Thank you!
Seems to struggle when certain other packages are imported, so far I have found bs4 causes an issue.
from pytessy import pytessy
from bs4 import BeautifulSoup
digit_reader = pytessy.PyTessy()
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\dev\lib\site-packages\IPython\core\interactiveshell.py", line 3296, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 2, in
digit_reader = pytessy.PyTessy()
File "C:\ProgramData\Anaconda3\envs\dev\lib\site-packages\pytessy\pytessy.py", line 322, in init
language=language)
File "C:\ProgramData\Anaconda3\envs\dev\lib\site-packages\pytessy\pytessy.py", line 86, in init
self.setup_lib(lib_path)
File "C:\ProgramData\Anaconda3\envs\dev\lib\site-packages\pytessy\pytessy.py", line 157, in setup_lib
cls.lib = lib = ctypes.CDLL(lib_path)
File "C:\ProgramData\Anaconda3\envs\dev\lib\ctypes_init.py", line 356, in init
self._handle = _dlopen(self._name, mode)
OSError: [WinError 127] The specified procedure could not be found
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.