-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
why useing the cnOCR it's not accurate as you are using easyocr then it is fine #130
Comments
Which kinds of images. You can change the code to use other ocr engines. |
one more problem i saw is that the text output is different if I use raw easyocr and your pix2tex.recognize_text_formula here is pix2tex output :
here is easyocr output:
extracted texts are perfect in this raw easyocrand I am using easyocr I know as I have changed the def prepare_ocr_engine(languages: Sequence[str], ocr_engine_config):
ocr_engine_config = deepcopy(ocr_engine_config) if ocr_engine_config else {}
if 1==2:
from cnocr import CnOcr
if 'ch_sim' not in languages and 'cand_alphabet' not in ocr_engine_config: # only recognize english characters
ocr_engine_config['cand_alphabet'] = string.printable
ocr_engine = CnOcr(**ocr_engine_config)
engine_wrapper = CnOCREngine(languages, ocr_engine)
else:
print("using easyocr")
try:
from easyocr import Reader
except:
raise ImportError('Please install easyocr first: pip install easyocr')
gpu = False
if 'context' in ocr_engine_config:
context = ocr_engine_config.pop('context').lower()
gpu = 'gpu' in context or 'cuda' in context
ocr_engine = Reader(lang_list=['en'], gpu=gpu, **ocr_engine_config)
engine_wrapper = EasyOCREngine(languages, ocr_engine)
return engine_wrapper |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: